diff --git a/packages/uni-core/src/view/plugin/componentWxs.ts b/packages/uni-core/src/view/plugin/componentWxs.ts index 9d339980074287f9a0b95c3acce8b943d1acb2e1..0a39270addc763444f858907a4eee4e059a9738c 100644 --- a/packages/uni-core/src/view/plugin/componentWxs.ts +++ b/packages/uni-core/src/view/plugin/componentWxs.ts @@ -31,9 +31,11 @@ function ensureEl(vm: ComponentPublicInstance) { const vnode = vm.$.subTree // ShapeFlags.ARRAY_CHILDREN = 1 << 4 // ShapeFlags.ELEMENT = 1 + if (vnode.shapeFlag & (1 << 4)) { const elemVNode = (vnode.children as VNode[]).find( - (vnode) => vnode.shapeFlag & 1 + // element || component + (vnode) => vnode.shapeFlag & 1 || vnode.shapeFlag & 6 ) if (elemVNode) { return elemVNode.el