Skip to content

Commit

Permalink
fix(observer): invoke getters on initial observation if setter defined (
Browse files Browse the repository at this point in the history
  • Loading branch information
pkaminski authored and aJean committed Aug 19, 2020
1 parent 9070ef0 commit 5999fc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/observer/index.js
Expand Up @@ -147,10 +147,10 @@ export function defineReactive (

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

let childOb = !shallow && observe(val)
Object.defineProperty(obj, key, {
Expand Down

0 comments on commit 5999fc2

Please sign in to comment.