商城详情数据的增加和删除

布局

          
            
            
              
            
          
          

参数

      index: 1,
      formDynamic: {
        items: [
          {
            thePurchaseTime: "",
            price: "",
            theOriginalPrice: "",
            index: 1,
            status: 1
          }
        ]
      }

方法

    //商城购买 新增数据
    handleAdd() {
      this.index++;
      this.formDynamic.items.push({
        value: "",
        index: this.index,
        status: 1
      });
    },
    //删除所在行详情数据
    handleRemove(index) {
        console.log(this.formDynamic.items)
      this.formDynamic.items[index].status = 0;
    //   this.formDynamic.items = this.formDynamic.items
    },

你可能感兴趣的:(商城详情数据的增加和删除)