mirror of https://github.com/vuejs/vue.git
fix(observer): do not invoke getters on initial observation (#7302)
fix #7280
This commit is contained in:
parent
f7311c90b3
commit
7392dfcc1d
|
|
@ -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])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue