Skip to content

Commit 12b9480

Browse files
committed
bugfix:_computedWatchers应该赋值_computedWatcher['value'],不是监听对象本身,否则
会引发循环引用
1 parent c2eaf76 commit 12b9480

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/mpvue/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5469,7 +5469,7 @@ function diffData (vm, data) {
54695469
data[rootKey + '.' + mpItemKey] = vmMpProps[mpItemKey];
54705470
});
54715471
Object.keys(vmComputedWatchers).forEach(function (computedItemKey) {
5472-
data[rootKey + '.' + computedItemKey] = vmComputedWatchers[computedItemKey];
5472+
data[rootKey + '.' + computedItemKey] = vmComputedWatchers[computedItemKey]['value'];
54735473
});
54745474
// 更新的时候要删除$root.0:{},否则会覆盖原正确数据
54755475
delete data[rootKey];

src/platforms/mp/runtime/diff-data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export function diffData (vm, data) {
144144
data[rootKey + '.' + mpItemKey] = vmMpProps[mpItemKey]
145145
})
146146
Object.keys(vmComputedWatchers).forEach((computedItemKey) => {
147-
data[rootKey + '.' + computedItemKey] = vmComputedWatchers[computedItemKey]
147+
data[rootKey + '.' + computedItemKey] = vmComputedWatchers[computedItemKey]['value']
148148
})
149149
// 更新的时候要删除$root.0:{},否则会覆盖原正确数据
150150
delete data[rootKey]

0 commit comments

Comments
 (0)