4. 更新列表数据
1.方法一,添加新数据
methods: {
addItem () {
this.list.push({
title: 'abc',
price: 30
})
}
}
2.方法二,更改列表某一项值
Vue.set(this.list, 2, {
title: 'abc',
price: 30
})
Vue.set(要更新的列表, 更新第几项, 要更新的数据)

浙公网安备 33010602011771号