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

Commit

Permalink
v8.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaorun343 committed Mar 17, 2020
1 parent 62433c1 commit a5fd1aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-property-decorator",
"version": "8.4.0",
"version": "8.4.1",
"description": "property decorators for Vue Component",
"main": "lib/vue-property-decorator.umd.js",
"module": "lib/vue-property-decorator.js",
Expand Down
30 changes: 17 additions & 13 deletions src/vue-property-decorator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** vue-property-decorator verson 8.4.0 MIT LICENSE copyright 2019 kaorun343 */
/** vue-property-decorator verson 8.4.1 MIT LICENSE copyright 2019 kaorun343 */
/// <reference types='reflect-metadata'/>
'use strict'
import Vue, { PropOptions, WatchOptions } from 'vue'
Expand Down Expand Up @@ -73,11 +73,15 @@ function produceProvide(original: any) {
for (let i in provide.managedReactive) {
rv[provide.managedReactive[i]] = this[i] // Duplicates the behavior of `@Provide`
if (!rv[reactiveInjectKey].hasOwnProperty(provide.managedReactive[i])) {
Object.defineProperty(rv[reactiveInjectKey], provide.managedReactive[i], {
enumerable: true,
get: () => this[i],
})
}
Object.defineProperty(
rv[reactiveInjectKey],
provide.managedReactive[i],
{
enumerable: true,
get: () => this[i],
},
)
}
}
return rv
}
Expand Down Expand Up @@ -262,18 +266,18 @@ export function Emit(event?: string) {
const original = descriptor.value
descriptor.value = function emitter(...args: any[]) {
const emit = (returnValue: any) => {
const emitName = event || key;
if (returnValue === undefined) {
const emitName = event || key

if (returnValue === undefined) {
if (args.length === 0) {
this.$emit(emitName);
this.$emit(emitName)
} else if (args.length === 1) {
this.$emit(emitName, args[0]);
this.$emit(emitName, args[0])
} else {
this.$emit(emitName, args);
this.$emit(emitName, args)
}
} else {
this.$emit(emitName, returnValue);
this.$emit(emitName, returnValue)
}
}

Expand Down

0 comments on commit a5fd1aa

Please sign in to comment.