vue管理后台列表实现拖拽

1、引入js方法
"sortablejs": "^1.14.0", 
npm install sortablejs --save
import Sortable from 'sortablejs'
2、
rowDrop() {
      const tbody = document.querySelector('.el-table__body-wrapper tbody')
      const _this = this
      Sortable.create(tbody, {
        onEnd({ newIndex, oldIndex }) {
          const currRow = _this.tableData.splice(oldIndex, 1)[0]//老的数据
          _this.tableData.splice(newIndex, 0, currRow)//替换掉老的一列数据
           let sortedArray = _this.tableData

vue管理后台列表实现拖拽最先出现在Python成神之路

版权声明:
作者:congcong
链接:https://www.techfm.club/p/21088.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>