vue中 el-table中如何控制行的上下移动
在vue项目中遇到一个问题: el-table中的数据如何手动控制行的上下移动进行数据排序。现在问题已经解决了,分享一下。直接上代码:(只粘贴主要的代码)
html中的代码:
<el-table
:data="tableData"
:height="tableHeight"
:header-cell-style="tableHeaderColor"
stripe
border>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<i class="el-icon-bottom icon_class"@click="moveDown(scope.$index,scope.row)"/>
<i class="el-icon-top icon_class" @click="moveUp(scope.$index,scope.row)"/>
</template>
</el-table-column>
</el-table>
js中的代码: