表格一列数据上下移动

addRow() {
this.vatList.push(
new VatItem()
);
}
removeRow(i) {
this.vatList.splice(i, 1);
}

upRow(i) {
const rowItem = this.vatList[i];
this.vatList[i] = this.vatList[i - 1];
this.vatList[i - 1] = rowItem;
}

downRow(i) {
const rowItem = this.vatList[i];
this.vatList[i] = this.vatList[i + 1];
this.vatList[i + 1] = rowItem;
}

addSubRow(i) {
this.vatList.splice(i + 1, 0, new VatItem());
}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • "use strict";function _classCallCheck(e,t){if(!(e instanc...
    久些阅读 2,062评论 0 2
  • 单例模式 适用场景:可能会在场景中使用到对象,但只有一个实例,加载时并不主动创建,需要时才创建 最常见的单例模式,...
    Obeing阅读 2,120评论 1 10
  • 不支持上传文件,所以就复制过来了。作者信息什么的都没删。对前端基本属于一窍不通,所以没有任何修改,反正用着没问题就...
    全栈在路上阅读 2,006评论 0 2
  • Data Visualization with D3 D3: SVG中的jQurey 1. Add Documen...
    王策北阅读 793评论 0 2
  • 六项精进打卡 姓名:丁志强 公司:深圳市正大信维通讯设备有限公司 时间:2019年07月4日 【日精进打卡第34天...
    丁俊友阅读 123评论 0 0