有个需求cate_list数字里面的对象比如quantity数量改变以及is_select数量改变需要watch可以触发并监到变化
watch: {
skuShow: 'get_item_sku',
cart_list: {
handler: function(newVal, oldVal) {
console.log(newVal);
},
deep: true,
}
},
"cart_list": [{
"id": "10",
"item_id": "1408",
"item_name": "\u840c\u716e miYmiY\u5b9d\u5b9d\u4e13\u5c5e\u8425\u517b\u7c73",
"sku_name": "\u6708\u5ea6\u5305",
"quantity": "2",
"is_select": "1",
"old_price": "0",
"price": "99.00",
"total": "198.00",
}, {
"id": "9",
"item_id": "1408",
"item_name": "\u840c\u716e miYmiY\u5b9d\u5b9d\u4e13\u5c5e\u8425\u517b\u7c73",
"sku_name": "7\u5929\u8bd5\u5403\u5305",
"quantity": "2",
"is_select": "1",
"old_price": "0",
"price": "38.00",
"total": "76.00",
}]
把数组转字符串存储,用的时候再解析为数组: