WEB前端笔记本

elemetnui删除一条表格数据和追加一条数据

2019-10-14  本文已影响0人  蜗牛和曼巴

删除

     <template slot-scope="scope">
              <span class="btn-danger" @click="deleteRow(scope.$index, tableData)">删除</span>
            </template>
  deleteRow(index, rows) {
      rows.splice(index, 1)
    },

追加

<el-button type="primary" @click="handleAdd">增加</el-button>
   handleAdd() {
      this.tableData.push({
        name: '',
        code: '',
        description: ''
      })
    },
上一篇 下一篇

猜你喜欢

热点阅读