提交 b47f7fae 编写于 作者: fxy060608's avatar fxy060608

fix(mp-weixin): intercept mutating methods (Array) #691 #694

上级 993fd827
......@@ -910,7 +910,13 @@ var Observer = function Observer (value) {
def(value, '__ob__', this);
if (Array.isArray(value)) {
if (hasProto) {
protoAugment(value, arrayMethods);
{// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
if(value.push !== value.__proto__.push){
copyAugment(value, arrayMethods, arrayKeys);
} else {
protoAugment(value, arrayMethods);
}
}
} else {
copyAugment(value, arrayMethods, arrayKeys);
}
......@@ -2479,7 +2485,12 @@ function resolveSlots (
slot.push(child);
}
} else {
(slots.default || (slots.default = [])).push(child);
// fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
(slots['page'] || (slots['page'] = [])).push(child);
}else{
(slots.default || (slots.default = [])).push(child);
}
}
}
// ignore slots that contains only whitespace
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册