diff --git a/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts b/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts index c268aaa89bbc98850b5115345105b332c0b8a68f..9020e5a3b4bd44066c3b609f392f6b63be7d7e3d 100644 --- a/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts +++ b/packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts @@ -192,6 +192,10 @@ export class UniContainerComponent extends UniComponent { queuePostActionJob(this.getRebuildFn(), JOB_PRIORITY_REBUILD) return super.insertBefore(newChild, refChild) } + removeUniChild(node: UniNode) { + queuePostActionJob(this.getRebuildFn(), JOB_PRIORITY_REBUILD) + return super.removeUniChild(node) + } rebuild() { // 刷新容器组件状态 if (__DEV__) { diff --git a/packages/uni-components/src/vue/picker-view-column/index.tsx b/packages/uni-components/src/vue/picker-view-column/index.tsx index 932c462dddc2ce367a6ea227c7f836559f211af6..4abb5de65c880edf1dc5f00d22d60bd4655d5988 100644 --- a/packages/uni-components/src/vue/picker-view-column/index.tsx +++ b/packages/uni-components/src/vue/picker-view-column/index.tsx @@ -251,11 +251,15 @@ export default /*#__PURE__*/ defineBuiltInComponent({ } if (__PLATFORM__ === 'app') { + let isMounted: boolean = false useRebuild(() => { state.length = (contentRef.value as HTMLElement).children.length - // 由于 App 端 onMounted 时机未插入真实位置,需重新执行 - initIndicatorHeight() - initScroller() + if (!isMounted) { + isMounted = true + // 由于 App 端 onMounted 时机未插入真实位置,需重新执行 + initIndicatorHeight() + initScroller() + } }) }