Skip to content

Commit 82c94d1

Browse files
committed
_mpProps和_computedWathers保持和原版同样处理
1 parent 12b9480 commit 82c94d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/mpvue/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5466,10 +5466,10 @@ function diffData (vm, data) {
54665466
var vmMpProps = vm._mpProps || {};
54675467
var vmComputedWatchers = vm._computedWatchers || {};
54685468
Object.keys(vmMpProps).forEach(function (mpItemKey) {
5469-
data[rootKey + '.' + mpItemKey] = vmMpProps[mpItemKey];
5469+
data[rootKey + '.' + mpItemKey] = vm[mpItemKey];
54705470
});
54715471
Object.keys(vmComputedWatchers).forEach(function (computedItemKey) {
5472-
data[rootKey + '.' + computedItemKey] = vmComputedWatchers[computedItemKey]['value'];
5472+
data[rootKey + '.' + computedItemKey] = vm[computedItemKey];
54735473
});
54745474
// 更新的时候要删除$root.0:{},否则会覆盖原正确数据
54755475
delete data[rootKey];

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ export function diffData (vm, data) {
141141
const vmMpProps = vm._mpProps || {}
142142
const vmComputedWatchers = vm._computedWatchers || {}
143143
Object.keys(vmMpProps).forEach((mpItemKey) => {
144-
data[rootKey + '.' + mpItemKey] = vmMpProps[mpItemKey]
144+
data[rootKey + '.' + mpItemKey] = vm[mpItemKey]
145145
})
146146
Object.keys(vmComputedWatchers).forEach((computedItemKey) => {
147-
data[rootKey + '.' + computedItemKey] = vmComputedWatchers[computedItemKey]['value']
147+
data[rootKey + '.' + computedItemKey] = vm[computedItemKey]
148148
})
149149
// 更新的时候要删除$root.0:{},否则会覆盖原正确数据
150150
delete data[rootKey]

0 commit comments

Comments
 (0)