做一个根据id返回对应名称的过滤函数,记录如下报错
报错:Property 'xxx' does not exist on type 'never'.Vetur(2339)
我获取到的数据是:{__ob__: we}对象形式的数组
解决方法:通过字符方式获取对象属性【来自大神:EsquireY】
growthStageFormat(id){
let label = '';
// 重点来啦
this.stepAttr.find((item) => {
if (item["growthStageId"] == id) {
label = item["stageName"]
}
});
return label
},

显示正常OOKK!
版权声明:本文为weixin_38990605原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。