ArkTS开发中,如何解决“Component not registered”组件未注册异常?

阅读 603
1 个回答

可以参考@Component注解的说明:@Component装饰器仅能装饰struct关键字声明的数据结构。struct被@Component装饰后具备组件化的能力,需要实现build方法描述UI,一个struct只能被一个@Component装饰。@Component可以接受一个可选的bool类型参数。

参考链接:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...