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

fix(h5): wxs

上级 9ec2a554
......@@ -189,14 +189,13 @@ function createComponentDescriptor(
vm: ComponentPublicInstance,
isOwnerInstance = true
) {
if (
isOwnerInstance &&
vm &&
vm.$options.name &&
isBuiltInComponent(hyphenate(vm.$options.name))
) {
// ownerInstance 内置组件需要使用父 vm
vm = vm.$parent!
if (isOwnerInstance && vm) {
let componentName = vm.$options && vm.$options.name
while (componentName && isBuiltInComponent(hyphenate(componentName))) {
// ownerInstance 内置组件需要使用父 vm
vm = vm.$parent!
componentName = vm.$options && vm.$options.name
}
}
if (vm && vm.$el) {
if (!vm.$el.__wxsComponentDescriptor) {
......
......@@ -9146,8 +9146,9 @@ function patchWxs(el, rawName, nextValue, instance = null) {
const proxy = instance.proxy;
const name = rawName.split(':')[1];
el.__wxsWatches[rawName] = proxy.$watch(() => instance.attrs[name], (value, oldValue) => {
// TODO ownerInstance,instance
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, true));
nextTick(() => {
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, false));
});
}, {
deep: true
});
......
......@@ -11014,8 +11014,9 @@ function patchWxs(el, rawName, nextValue, instance = null) {
const proxy = instance.proxy;
const name = rawName.split(':')[1];
el.__wxsWatches[rawName] = proxy.$watch(() => instance.attrs[name], (value, oldValue) => {
// TODO ownerInstance,instance
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, true));
nextTick(() => {
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, false));
});
}, {
deep: true
});
......
......@@ -11070,8 +11070,9 @@ function patchWxs(el, rawName, nextValue, instance = null) {
const proxy = instance.proxy;
const name = rawName.split(':')[1];
el.__wxsWatches[rawName] = proxy.$watch(() => instance.attrs[name], (value, oldValue) => {
// TODO ownerInstance,instance
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, true));
nextTick(() => {
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, false));
});
}, {
deep: true
});
......
......@@ -9198,8 +9198,9 @@ function patchWxs(el, rawName, nextValue, instance = null) {
const proxy = instance.proxy;
const name = rawName.split(':')[1];
el.__wxsWatches[rawName] = proxy.$watch(() => instance.attrs[name], (value, oldValue) => {
// TODO ownerInstance,instance
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, true));
nextTick(() => {
nextValue(value, oldValue, proxy.$gcd(proxy, true), proxy.$gcd(proxy, false));
});
}, {
deep: true
});
......
......@@ -1323,8 +1323,12 @@ class ComponentDescriptor {
}
}
function createComponentDescriptor(vm, isOwnerInstance = true) {
if (isOwnerInstance && vm && vm.$options.name && isBuiltInComponent(hyphenate(vm.$options.name))) {
vm = vm.$parent;
if (isOwnerInstance && vm) {
let componentName = vm.$options && vm.$options.name;
while (componentName && isBuiltInComponent(hyphenate(componentName))) {
vm = vm.$parent;
componentName = vm.$options && vm.$options.name;
}
}
if (vm && vm.$el) {
if (!vm.$el.__wxsComponentDescriptor) {
......
......@@ -55,9 +55,9 @@ export function uniPreVuePlugin(): Plugin {
if (hasWxs) {
code = normalizeWxsCode(ast, code)
}
if (errors.length) {
this.error(errors.join('\n'))
}
// if (errors.length) {
// this.error(errors.join('\n'))
// }
sourceToSFC.set(sourceKey, code)
return code // 暂不提供sourcemap,意义不大
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册