Skip to content

Commit

Permalink
fix(observer): do not invoke getters on initial observation (vuejs#7302)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeyLak authored and hefeng committed Jan 25, 2019
1 parent 97e58f1 commit a7e52a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/observer/index.js
Expand Up @@ -61,7 +61,7 @@ export class Observer {
walk (obj: Object) {
const keys = Object.keys(obj)
for (let i = 0; i < keys.length; i++) {
defineReactive(obj, keys[i], obj[keys[i]])
defineReactive(obj, keys[i])
}
}

Expand Down Expand Up @@ -145,6 +145,9 @@ export function defineReactive (

// cater for pre-defined getter/setters
const getter = property && property.get
if (!getter && arguments.length === 2) {
val = obj[key]
}
const setter = property && property.set

let childOb = !shallow && observe(val)
Expand Down

0 comments on commit a7e52a2

Please sign in to comment.