构建第一个HarmonyOS 鸿蒙Next ArkTs应用提示 'code' is declared but its value is never read. <ArkTSCheck>
构建第一个HarmonyOS 鸿蒙Next ArkTs应用提示 ‘code’ is declared but its value is never read. <ArkTSCheck> 我在学习“构建第一个ArkTs应用”时,把示例代码运行了一下,在编辑“实现页面间的跳转”代码时提示变量未使用
‘code’ is declared but its value is never read.
‘message’ is declared but its value is never read.
页面地址:https://developer.huawei.com/consumer/cn/training/course/slightMooc/C101717494752698457
// 返回按钮绑定onClick事件,点击按钮时返回到第一页
.onClick(() => {
console.info(Succeeded in clicking the 'Back' button.
)
try {
// 返回第一页
router.back()
console.info(‘Succeeded in returning to the first page.’)
} catch (err) {
let code = (err as BusinessError).code;
let message = (err as BusinessError).message;
console.error(Failed to return to the first page. Code is ${code}, message is ${message}
)
}
})
更多关于构建第一个HarmonyOS 鸿蒙Next ArkTs应用提示 'code' is declared but its value is never read. <ArkTSCheck>的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
你用的啥版本的IDE工具?我这边好像没这个问题,升级到最新版本试一试呢
更多关于构建第一个HarmonyOS 鸿蒙Next ArkTs应用提示 'code' is declared but its value is never read. <ArkTSCheck>的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
这是编译器的BUG,不影响运行。