鸿蒙HarmonyOS提示:'@Prop' decorated 'icon' must be initialized through the component constructor. 的解决办法

鸿蒙HarmonyOS在DevEco开发中,给子组件传值时,会出现如下提示:

'@Prop' decorated 'icon' must be initialized through the component constructor. <etsLint>

鸿蒙HarmonyOS提示:'@Prop' decorated 'icon' must be initialized through the component constructor. <etsLint>的解决办法

这种情况,大概率是传递的变量名和接收的变量名不一致的问题导致的。

修改成一样的就好了。

评论 (0)

未连接

暂无评论,快来发表第一条评论吧!