dcloudio / uni-ui

基于uni-app的、全端兼容的、高性能UI框架
https://uniapp.dcloud.io/component/uniui/uni-ui.html
Apache License 2.0
1.88k stars 667 forks source link

模板中使用和render渲染函数中使用 #920

Closed kang-hui-jun closed 3 months ago

kang-hui-jun commented 3 months ago

我是使用npm i @dcloudio/uni-ui方式安装的, 在template中使用完全没问题:

    </uni-forms-item>

在渲染函数中使用会报错 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.

bfc846958672 commented 3 months ago

你好,如果使用render函数,需要在当前组件import引入所需的uni-ui组件。 推荐使用template, 因为render函数不支持 小程序

kang-hui-jun commented 3 months ago

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: @.***>