HarmonyOS @Entry的编译警告It’s not a recommended way to export struct with @Entry decorator, which may cause ACE Engine error in component preview mode.
我的代码是这样:
@Entry
@Component
export struct DefaultWebviewPage {
routeParams?: RouteItemContext;//初始化进来的参数
startParams: Record<string, Object> = {}
HarmonyOS
赞
收藏 0
回答 1
待解决
相关问题
HarmonyOS Entry组件export会有黄色警告
1183浏览 • 1回复 待解决
Tabs的具体使用方法,我这个报错The variable with @Link in component with @Preview may cause error in
786浏览 • 1回复 已解决
报错:“A page must have one and only one '@Entry' decorator with a struct.”
10970浏览 • 1回复 待解决
编译报错A page configured in 'main_pages.json' must have one and only one '@Entry' decorator.
3678浏览 • 1回复 待解决
@Entry与@Component有什么区别?
3281浏览 • 2回复 待解决
ACE ENGINE是否需要MMU的支持?
8031浏览 • 1回复 待解决
在struct上面加了@entry还是收不到onPageShow的回调
2606浏览 • 1回复 待解决
HarmonyOS export struct的初始化参数
1372浏览 • 1回复 待解决
HarmonyOS 多个Entry类的Component组件或是多个普通的Component组件基类问题
1025浏览 • 1回复 待解决
A problem occurred configuring project ':entry'. > An error occur in configuration.
7744浏览 • 1回复 待解决
A problem occurred configuring project ':entry'. > Unable to download the HarmonyOS SDK. proxyHost s
13149浏览 • 2回复 待解决
不小心把entry下面的build和preview删了,怎么生成?
2251浏览 • 1回复 待解决
HarmonyOS entry、har 同路径、同名文件编译时的合并机制
1205浏览 • 1回复 待解决
@Entry入口Component是否可以继承一个自定义的baseComponent?
1708浏览 • 1回复 待解决
HarmonyOS 自定义弹窗能否在 非 Component 或 Entry 修饰的文件中弹出
851浏览 • 1回复 待解决
HarmonyOS @Entry的组件相关问题
966浏览 • 1回复 待解决
HarmonyOS entry组件的横竖屏
689浏览 • 1回复 待解决
HarmonyOS entry模块声明的问题
1004浏览 • 1回复 待解决
HarmonyOS entry的label如何在编译的时候通过product和target动态修改
937浏览 • 1回复 待解决
错误码code:9568287 error: install invalid number of entry hap.怎么处理?
1241浏览 • 1回复 待解决
HarmonyOS XCode 15.3无法编译flutter engine
891浏览 • 1回复 待解决
HarmonyOS Entry定义的页面没有触发onPageShow
991浏览 • 1回复 待解决
HarmonyOS 在entry里替换首页
1134浏览 • 1回复 待解决
CustomDialogController仅在作为@CustomDialog和@Component struct的成员变量问题
920浏览 • 1回复 待解决
@Entry表明组件为入口页面,新版本为了防止组件预览模式下的ACE引擎错误,不推荐导出@Entry修饰的组件结构体。此处可以去掉@Entry,自定义组件是不需要@Entry修饰;如果此处需要同时使用的话,可以忽略。
自定义组件用法:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-create-custom-components-V5#自定义组件的基本用法
命名路由是类似的用法,可以参考一下:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-routing-V5#命名路由