vue+elementUI 在表格中动态增加与删除行
1、定义一个数组,存放表格数据(注:表格要给定一个高度,添加数据超过这个高度会自动出现滚动条)
ttable:[],
2、把数组中表格的每一行定义成一个对象,添加到数组中
newconditions:function(){
var newValue = {};
//添加新的行数
this.ttable.push(newValue);
},
3、删除对象
remove:function(index,row){//删除行数
this.ttable.splice(index, 1)
},