diff --git a/packages/uni-mp-vue/src/helpers/withScopedSlot.ts b/packages/uni-mp-vue/src/helpers/withScopedSlot.ts index dc3396f61f8c20d47b9be5a64077a5a27be14a75..a9162f393795589a4f889800dfc5040de401507e 100644 --- a/packages/uni-mp-vue/src/helpers/withScopedSlot.ts +++ b/packages/uni-mp-vue/src/helpers/withScopedSlot.ts @@ -57,6 +57,10 @@ function createScopedSlotInvoker(instance: ComponentInternalInstance) { index?: number ) => { const slot = invoker.slots[slotName] + if (!slot) { + // slot 可能不存在 https://github.com/dcloudio/uni-app/issues/3346 + return + } const hasIndex = typeof index !== 'undefined' index = index || 0 // 确保当前 slot 的上下文,类似 withCtx