zoukankan      html  css  js  c++  java
  • Element el-table 上移 下移

     1  //向上移动
     2   moveUp(index,row) {
     3       var that = this;
     4       console.log('上移',index,row);
     5       console.log(that.imageData[index]);
     6       if (index > 0) {
     7           let upDate = that.imageData[index - 1];
     8           that.imageData.splice(index - 1, 1);
     9           that.imageData.splice(index,0, upDate);
    10       } else {
    11         alert('已经是第一条,不可上移');
    12       }
    13   },
    14 //向下移动
    15 moveDown(index,row){
    16    var that = this;
    17   console.log('下移',index,row);
    18   if ((index + 1) === that.imageData.length){
    19     alert('已经是最后一条,不可下移');
    20   } else {
    21     console.log(index);
    22     let downDate = that.imageData[index + 1];
    23     that.imageData.splice(index + 1, 1);
    24     that.imageData.splice(index,0, downDate);
    25   }
    26 },
    @click="moveDown(scope.$index,scope.row)"
    @click="moveUp(scope.$index,scope.row)"
  • 相关阅读:
    13-Smell味道-调味料
    12-Juice饮料
    11-Snack小吃
    10-Meat肉类
    09-Fruit水果
    08-Vegetables蔬菜
    [svc]共享内存
    [sql]sql的select字符串切割
    [js] 渲染树构建、布局及绘制
    [js]变量提升-关于条件
  • 原文地址:https://www.cnblogs.com/qjh0208/p/13846853.html
Copyright © 2011-2022 走看看