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 hefeng committed Jan 25, 2019
1 parent 105d3a2 commit c4b8f02
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 c4b8f02

Please sign in to comment.