Skip to content

Commit

Permalink
fix(core): 所有变异方法都需要更新 path
Browse files Browse the repository at this point in the history
  • Loading branch information
nishino-tsukasa committed Jul 23, 2019
1 parent 4836034 commit cdf5278
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions packages/core/weapp/observer/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,8 @@ methodsToPatch.forEach(function (method) {
}
}

let isInserted = false;
switch (method) {
case 'push':
case 'unshift':
isInserted = true;
break;
case 'splice':
isInserted = true;
break;
}
if (isInserted) ob.observeArray(ob.key, ob.value);
// 这里和 vue 不一样,所有变异方法都需要更新 path
ob.observeArray(ob.key, ob.value)
// notify change
ob.dep.notify();
return result;
Expand Down

0 comments on commit cdf5278

Please sign in to comment.