Closed kang-hui-jun closed 3 months ago
你好,如果使用render函数,需要在当前组件import引入所需的uni-ui组件。 推荐使用template, 因为render函数不支持 小程序
OK,明白了
---- 回复的原邮件 ---- | 发件人 | @.> | | 发送日期 | 2024年07月23日 13:12 | | 收件人 | dcloudio/uni-ui @.> | | 抄送人 | kang @.>, Author @.> | | 主题 | Re: [dcloudio/uni-ui] 模板中使用和render渲染函数中使用 (Issue #920) |
你好,如果使用render函数,需要在当前组件能具体引入所需的uni-ui组件。 推荐使用template, 因为render函数不支持 小程序
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
我是使用npm i @dcloudio/uni-ui方式安装的, 在template中使用完全没问题:
在渲染函数中使用会报错 render(h: CreateElement): VNode { return h( "uni-forms-item", { props: { label: this.itemConfig.label, name: this.itemConfig.name, }, },
报错内容: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.