b2nil / taro-ui-vue3

采用 Vue 3.0 重写的 Taro UI 组件库
https://b2nil.github.io/taro-ui-vue3/
MIT License
160 stars 51 forks source link

AtCurtain 报 Invalid VNode type: undefined (undefined) #53

Closed b2nil closed 3 years ago

b2nil commented 3 years ago

问题描述

default slot 语法问题导致以上错误。

版本信息

v1.0.0-alpha.12

涉及的平台

h5, 小程序

错误信息

// h5
runtime-core.esm-bundler.js?5c40:38 [Vue warn]: Invalid VNode type: undefined (undefined) 
  at <TaroView class="at-curtain__body" > 
  at <TaroView class="at-curtain__container" > 
  at <TaroView class="at-curtain at-curtain--closed" onTap=fn<onTap> > 
  at <AtCurtain isOpened=false closeBtnPosition="bottom" onClose=fn<bound onClose> > 
  at <TaroView class="page" style= {width: "100%", margin: "auto"}margin: "auto"width: "100%"__proto__: Object > 
  at <Page headerTitle="Curtain 幕帘" > 
  at <CurtainDemo tid="/pages/view/curtain/index" > 
  at <App>

// weapp
VM32:1 [Vue warn]: Invalid VNode type:  (undefined) 
  at <AtCurtain isOpened=true closeBtnPosition="top" onClose=fn<bound onClose> > 
  at <Page headerTitle="Curtain 幕帘" > 
  at <CurtainDemo tid="pages/view/curtain/index?__key_=16037124863712" > 
  at <App>

代码

{ default: () => [
  { default: () => slots.default && slots.default() }, // <- 问题写法

  h(View, {...})
]}