vue报错:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....

报错信息:

vue报错:[Vue warn]: Invalid prop: type check failed for prop

错误原因:

input绑定item.attr_vals传入了空值,说明定义的onlyTabData有错

   
 
解决方案:
查找后续的有关onlyTabData的赋值操作,看是否传入的值有问题  发现是给this.onlyTabData赋值出问题,下面是修改过后正确的代码
 
async tabClicked() {
if ( this. activeIndex === '2') {
const { data: res } = await this. $http. get(
`categories/ ${ this. cateId } /attributes`,
{ params: { sel: 'only' } }
)
if ( res. meta. status !== 200)
return this. $message. error( '获取静态属性失败')
this. onlyTabData = res. data
console. log( res. data)
}
}

转载于:https://www.cnblogs.com/yangxiaobai123/p/11161173.html

你可能感兴趣的:(vue报错:[Vue warn]: Invalid prop: type check failed for prop "value". Expected Number, got String....)