HarmonyOS 新API属性不能被定义为undefined吗?
有一个工程,上面的的属性定义是这样的
然后编译就报了很多错误,其中这两种最多
他们这个项目 build-profile.json5里本来写的是“runtimeOS”: “OpenHarmony”但是这样编译报错,只能改成“runtimeOS”: “HarmonyOS”
请问上面报的两个错误怎么解决呢?
HarmonyOS
赞
收藏 0
回答 1
相关问题
HarmonyOS 读取剪贴板api获取内容为undefined
945浏览 • 1回复 待解决
API15中InteractionHand枚举类型为undefined
243浏览 • 0回复 待解决
HarmonyOS 间接使用自定义Dialog,controller属性undefined问题
938浏览 • 1回复 待解决
HarmonyOS router传参,结构包含多层时,内部属性类型为undefined
644浏览 • 1回复 待解决
HarmonyOS UIAbilityContext.openLink 为 undefined
759浏览 • 1回复 待解决
HarmonyOS CustomDialog中的CustomDialogController 为undefined
1201浏览 • 1回复 待解决
HarmonyOS SourceTool.xxx值为undefined
823浏览 • 1回复 待解决
如何获取单例为undefined
1351浏览 • 1回复 待解决
HarmonyOS width属性设置为undefined不报错,想确认一下这个操作是否安全
563浏览 • 1回复 待解决
Grid组件高度不能被GridItem高度自动撑起,必须要设置height或maxCount属性
1584浏览 • 1回复 待解决
华为不能完全自主开发新内核吗?
14714浏览 • 2回复 已解决
HarmonyOS NEXT开发中遇到UIAbilityContext.openLink 为 undefined
253浏览 • 0回复 待解决
HarmonyOS 新的HarmonyOS API可以嵌套Flutter混合开发吗?是否有成熟的案例?
966浏览 • 1回复 待解决
HarmonyOS swiper的displayCount设置为auto,如果item使用position属性时,不能系统自适应
558浏览 • 1回复 待解决
HarmonyOS 使用JSON.parse转json对象取值为undefined
1080浏览 • 1回复 待解决
暴露给js的对象内部不能使用this(undefined)。
1285浏览 • 1回复 待解决
#鸿蒙通关秘籍#如何解决Node-API导入的模块为undefined或不可调用的问题?
762浏览 • 1回复 待解决
为为什么很多人在质疑鸿蒙,是被谁带了节奏吗?
4808浏览 • 1回复 待解决
HarmonyOS Image组件的图片地址不能设置为相对路径吗?
1184浏览 • 1回复 待解决
HarmonyOS 自定义组件最外层定义visibility属性为Visible后,组件加载完成不显示了
893浏览 • 1回复 待解决
HarmonyOS使用as关键字转换为指定类型,结果为undefined
1624浏览 • 1回复 待解决
怎样防止API被恶意调用?
2534浏览 • 1回复 待解决
HarmonyOS Slider 设置为竖直方向,blockStyle为IMAGE,滑竿不能滑动
798浏览 • 1回复 待解决
HarmonyOS 自定义Dialog,autoCancel属性和onWillDismiss会冲突吗
743浏览 • 1回复 待解决
HarmonyOS 嵌套自定义类型引用的undefined判断
648浏览 • 1回复 待解决
private cameraMgr: camera.CameraManager | undefined = undefined;
let imageBuffer: Uint8Array | undefined;
相机创建等AP可以参考官方文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references/js-apis-camera-0000001820881333#ZH-CN_TOPIC_0000001811317606__cameragetcameramanager
另外TS 到ArtTs存在语法上的适配,可以参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides/arkts-migration-background-0000001820999541#ZH-CN_TOPIC_0000001857876137__%E5%85%BC%E5%AE%B9tsjs%E7%9A%84%E7%BA%A6%E6%9D%9F
建议将globalThis,还有其他的一些变量,放到公共的文件中,哪个.ets需要调用直接导入。