关于vue v-for 嵌套v-for的v-model属性绑定问题

vue v-for嵌套v-for的v-model属性绑定,如果数据类型不对,常会报错

如:

//数据

data: {

childrenList: [{sku:'',quantity:1,start_price:''}],

},

//dom渲染

//以上数据类型,让v-model无法绑定数据。

解决:改变数据类型:

childrenList: [{sku0:{sku:''},quantity0:{quantity:1},start_price0:{start_price:''}}],

//这样就可以了。

 

你可能感兴趣的:(vue)