报错:“A page must have one and only one '@Entry' decorator with a struct.”

报错:“A page must have one and only one '@Entry' decorator with a struct.”-开源基础软件社区

报错:“A page must have one and only one '@Entry' decorator with a struct.”-开源基础软件社区

从入口页面调取model文件夹下的ets文件中的数据,按照官方文档eTs编写的代码报错如下:“A page must have one and only one '@Entry' decorator with a struct.”

 

不知道问题出在哪,小白自学,大佬有时间帮忙瞅一眼。谢谢了

 

 

鸿蒙os报错
2021-12-21 15:45:07
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
qq61c180282de2c
1

已解决,在config.json中“pages” : [  配置了该文件 ],导致编译器认为此文件是页面,必须加修饰器@Entry

分享
微博
QQ
微信
回复
2021-12-21 17:12:25
相关问题
Page Ability 无法实现跳转
5633浏览 • 1回复 待解决
关于HAP包的entry和feature类型
6503浏览 • 1回复 待解决
entry下的module.json5中包含哪些信息?
1899浏览 • 1回复 待解决
entry中如何拉起另一个Module中的Ability
1313浏览 • 1回复 待解决
Build Output文件报错
5731浏览 • 1回复 待解决
使用fetch报错,fetch undefined
4725浏览 • 2回复 待解决
报错:Error while Deploying HAP。
6680浏览 • 2回复 待解决