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 aJean committed Aug 19, 2020
1 parent 3998479 commit 3e4e83f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/observer/index.js
Original file line number Diff line number Diff line change
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 3e4e83f

Please sign in to comment.