DevecoStudio学习之Assigning the attribute ‘xxx‘ to the ‘xxx‘ decorated attribute ‘props‘ is not allowed
在父组件中的ForEach 中引用了子组件,需要给子组件传递参数,传递的是item 的类型,但是报如下错误,
但是程序可以运行,但是一直标红看的也不舒服,如何解决呢?Assigning the attribute ‘iconButton’ to the ‘@ObjectLink’ decorated attribute ‘props’ is not allowed.
解决方案:
使用as 强转,传递确认数据类型