this.tableData.forEach((item, index) => { let ZKprice = (item.price * this.discount * 0.1).toFixed(2);
// 要修改的數據 索引 要改的值 三個參數 this.$set(this.tableData, index, { ZKprice: ZKprice, SetPrice: this.discount, limit_stock: item.limit_stock }); });
textJsona: function () { let vm = this let textJson300 = [ {t1: 't1',t2: 't2',t3: 't3'}, {t4: 't4',t5: 't5',t6: 't6'}, {t7: 't7',t8: 't8',t9: 't9'}, ] vm.$set(vm.textJson[1],'t5',textJson300[1].t5) //此時等效於 vm.$set(vm,'textJson',textJson300) }