HarmonyOS Cannot set property when setter is undefined
aboutToReuse(params: ReusableParams): void { // { ui: ThemeCard, isEnabling: boolean, }
Log.error(TAG, 'aboutToReuse: ’ + this.ui?.title + ‘, params:’ + JSON.stringify(params));
if (params !== undefined && params.ui !== undefined) {
this.ui = params?.ui as ThemeCard;
Log.error(TAG, 'aboutToReuse ------ : ’ + this.ui.getUnlockWallpaperUrl());
}
---- 对this.ui赋值的时候,报错
HarmonyOS
赞
收藏 0
回答 1
待解决
相关问题
HarmonyOS代码报错 cannot read property aboutToRender of undefined
973浏览 • 1回复 待解决
HarmonyOS 调试报错TypeError:Cannot read property xxx of undefined
1366浏览 • 1回复 待解决
Cannot read property mediaUris of undefined怎么回事啊?
995浏览 • 1回复 待解决
升级RN到4.1.0.300版本之后运行报错Error message:Cannot read property isDebugModeEnabled of undefined
1462浏览 • 1回复 待解决
项目编译报错TypeError: Cannot read properties of undefined (reading 'newFileToResourceList')
1818浏览 • 1回复 待解决
升级IDE后编译报错:hvigor ERROR: Error: TypeError, Cannot read properties of undefined (reading 'getParameter
784浏览 • 1回复 待解决
构造函数中调用napi_set_named_property修改ArkUI层属性能成功,其他地方无法设置成功
1214浏览 • 1回复 待解决
定位授权配置中ability和when的作用范围?
2253浏览 • 1回复 待解决
duplicate @Provide property with name userInfo.
2183浏览 • 1回复 待解决
HarmonyOS Cannot find name 'ESObject'
469浏览 • 0回复 待解决
HarmonyOS List提示undefined
144浏览 • 1回复 待解决
启动UIAbility时报“must have required property 'startWindowIcon'”错误
2291浏览 • 1回复 待解决
js sdk6 storage set失败
6538浏览 • 1回复 待解决
HarmonyOS photoAccessHelper.PhotoAsset set 支持哪些?
570浏览 • 0回复 待解决
HarmonyOS Object is possibly 'undefined'. <ArkTSCheck>报错
475浏览 • 1回复 待解决
HarmonyOS UIAbilityContext.openLink 为 undefined
339浏览 • 1回复 待解决
HarmonyOS set-cookie与网络请求相关的文档
321浏览 • 1回复 待解决
getContext 提示错误,Cannot find name 'getContext'
1327浏览 • 1回复 待解决
HarmonyOS创建前置广角相机返回undefined
608浏览 • 1回复 待解决
HarmonyOS SourceTool.xxx值为undefined
482浏览 • 1回复 待解决
使用fetch报错,fetch undefined
7739浏览 • 2回复 待解决
这个问题通常出现在尝试给一个没有setter的属性设置值的时候。这可能是因为你尝试给一个只读属性设置值,或者这个属性没有setter方法。
要解决这个问题,你需要检查代码中是否有没有setter方法的属性,如果有,你需要添加setter方法。