报错警告:
翻译成中文:
[Vue 警告]: 无效的 prop: 属性的类型检查失败“索引 Id”.具有值 NaN 的预期数字,得到值为“27-e61247c8-79f9-48b1-8dac-08d46a8f2a8b”的字符串。
子组件部分代码:
<model-list @model-attribute-right="showItemAttribute" :indexId="indexId"></model-list>
indexId: 0, //点击选择项id
this.indexId = id;
查看后发现是子组件传值类型有误 父组件接收的是Number型 我传过去的是String
故转换一下数据类型即可
<model-list @model-attribute-right="showItemAttribute" :indexId="indexId"></model-list>
indexId: 0, //点击选择项id
id = id * 1;
this.indexId = id;