Skip to content

Commit

Permalink
refactor: use utils proxy (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
QiuShuiBai committed Jul 2, 2021
1 parent d5f33bb commit a4d5979
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/instance.ts
Expand Up @@ -20,16 +20,14 @@ export function asVmProperty(
},
})
} else {
Object.defineProperty(vm, propName, {
enumerable: true,
configurable: true,
proxy(vm, propName, {
get: () => {
if (isReactive(propValue)) {
;(propValue as any).__ob__.dep.depend()
}
return propValue
},
set: (val) => {
set: (val: any) => {
propValue = val
},
})
Expand Down

0 comments on commit a4d5979

Please sign in to comment.