diff --git a/packages/uni-core/src/view/plugin/componentWxs.ts b/packages/uni-core/src/view/plugin/componentWxs.ts index ab44ea3535c04158d7dc651b734c4f5c60b5f13c..b6f6b4b2d0b0f6388f2d948e3110c46f24dc6a82 100644 --- a/packages/uni-core/src/view/plugin/componentWxs.ts +++ b/packages/uni-core/src/view/plugin/componentWxs.ts @@ -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) { diff --git a/packages/uni-h5-vue/dist/vue.runtime.cjs.js b/packages/uni-h5-vue/dist/vue.runtime.cjs.js index c6a80046e386a88668edafc7f61648fa5dee8cb5..6aa0f499e05c9d4d6af6070d48431f8dcb05158a 100644 --- a/packages/uni-h5-vue/dist/vue.runtime.cjs.js +++ b/packages/uni-h5-vue/dist/vue.runtime.cjs.js @@ -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 }); diff --git a/packages/uni-h5-vue/dist/vue.runtime.compat.cjs.js b/packages/uni-h5-vue/dist/vue.runtime.compat.cjs.js index f65b9a03018c8696b3e351146009212df5558abb..5799cfa2ec844a035d62fef66a35b7a0d841b9cc 100644 --- a/packages/uni-h5-vue/dist/vue.runtime.compat.cjs.js +++ b/packages/uni-h5-vue/dist/vue.runtime.compat.cjs.js @@ -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 }); diff --git a/packages/uni-h5-vue/dist/vue.runtime.compat.esm.js b/packages/uni-h5-vue/dist/vue.runtime.compat.esm.js index c18fe5db59a50a12723c0aeea181853f358a13dc..f0b547d1d2ea75f785dbec99cf72f3b0274ff398 100644 --- a/packages/uni-h5-vue/dist/vue.runtime.compat.esm.js +++ b/packages/uni-h5-vue/dist/vue.runtime.compat.esm.js @@ -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 }); diff --git a/packages/uni-h5-vue/dist/vue.runtime.esm.js b/packages/uni-h5-vue/dist/vue.runtime.esm.js index be41a7e1fc04b3aa531793e868c8a6eb12b05cd2..d733981bc39446c0400b638f588d44a2b5e6bcbb 100644 --- a/packages/uni-h5-vue/dist/vue.runtime.esm.js +++ b/packages/uni-h5-vue/dist/vue.runtime.esm.js @@ -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 }); diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index 6b91b95cdfd2f47d826882ac472ee44fc6da5f7f..594fadeee2015e0ee6375047eaaa6d24651f64c2 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -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) { diff --git a/packages/vite-plugin-uni/src/configResolved/plugins/preVue.ts b/packages/vite-plugin-uni/src/configResolved/plugins/preVue.ts index 2f451d55566cddcae23de86057f1f9fa027c2a1b..114abf17352e75c45727cf57616efd1747d7b549 100644 --- a/packages/vite-plugin-uni/src/configResolved/plugins/preVue.ts +++ b/packages/vite-plugin-uni/src/configResolved/plugins/preVue.ts @@ -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,意义不大 },