Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Prevent override the propertyKey
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJmpl3 committed Dec 22, 2019
1 parent 0fd366c commit 43c5573
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vue-property-decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ const hyphenate = (str: string) => str.replace(hyphenateRE, '-$1').toLowerCase()
* @return MethodDecorator
*/
export function Emit(event?: string) {
return function(_target: Vue, key: string, descriptor: any) {
key = hyphenate(key)
return function(_target: Vue, propertyKey: string, descriptor: any) {
const key = hyphenate(propertyKey)
const original = descriptor.value
descriptor.value = function emitter(...args: any[]) {
const emit = (returnValue: any) => {
Expand Down

0 comments on commit 43c5573

Please sign in to comment.