vue element 表格的动态增减表格行 html:12345678910111213141516171819202122232425<el-table size="mini" :data="eventSetings"> <el-table-column label="消费金额"> <template slot-scope="scope"> <el-input v-model="scope.row.money" size="mini" /> </template> </el-table-column> <el-table-column label="减免金额"> <template slot-scope="scope"> <el-input v-model="scope.row.reduce" size="mini" /> </template> </el-table-column> <el-table-column align="right"> <template slot="header" slot-scope="scope"> <el-button type="primary" @click="addEventSet">添 加</el-button> </template> <template slot-scope="scope"> <el-button size="mini" type="danger" @click="deleteEventSet(scope.$index, scope.row)" >删除</el-button > </template> </el-table-column> </el-table> js:12345678910111213141516171819202122232425// 数据部分eventSetings: [ { money: "", reduce: "", },]// 逻辑部分// 添加addEventSet() { this.eventSetings.push({ money: "", reduce: "", }); }, // 删除 deleteEventSet(index, data) { console.log(index, data); this.eventSetings.splice(index, 1); }, vue2 > 拿来主义 #vue2 #vue #elementUI vue element 表格的动态增减表格行 https://github.com/chergn/chergn.github.io/41127977ecc7/ 作者 全易 发布于 2024年3月28日 许可协议 echarts实现中国地图下钻进入下一级行政区(地图钻取) 上一篇 vue elementUI封装的无限多级导航菜单(递归循环) 下一篇