# table-drag 表格-拖拽
## 导入使用
```code[javascript]
import seTableSort from "ss-universal-client-web/comp/data/su-table-sort";
```
## 基本用法
:::demo
```html
<template>
    <div>
        <su-table-sort :data ='tableData' @sortChange='sortChange'>
            <el-table-column type="index"
                             :index="function(index){return index+1}">
            </el-table-column>
            <el-table-column prop="date" label="日期">
            </el-table-column>
            <el-table-column prop="name" label="姓名">
            </el-table-column>
            <el-table-column prop="address" label="地址">
            </el-table-column>
            <el-table-column prop="address" label="地址">
            </el-table-column>
            <el-table-column prop="addres1s" label="地址">
            </el-table-column>
            <el-table-column prop="address" label="地址">
            </el-table-column>
            <el-table-column label="操作" width="150">
                <template :slot-scope="scope">
                    <el-link type="primary">
                        查看
                    </el-link>
                    <el-link type="warning">
                        编辑
                    </el-link>
                    <el-link type="danger">
                        删除
                    </el-link>
                </template>
            </el-table-column>
        </su-table-sort>
    </div>
</template>

<script>
export default {
    components: {
        seTableSort
    },
    data () {
        return {
            tableData: [{
                "date": "2016-05-02",
                "name": "王小虎1",
                "province": "上海",
                "city": "普陀区",
                "address": "上海市普陀区金沙江路 1518 普陀区金沙江路 1518 弄",
                "zip": 200333,
                "tag": "家"
            },{
                "date": "2016-05-03",
                "name": "王小虎2",
                "province": "上海",
                "city": "普陀区",
                "address": "上海市普陀区金沙江路 1518 普陀区金沙江路 1518 弄",
                "zip": 200334,
                "tag": "家"
            },{
                "date": "2016-05-04",
                "name": "王小虎3",
                "province": "上海",
                "city": "普陀区",
                "address": "上海市普陀区金沙江路 1518 普陀区金沙江路 1518 弄",
                "zip": 200335,
                "tag": "家"
            }]
        }
    },
    methods:{
        sortChange({resolve,reject,rowData,newIndex,oldIndex}){
            setTimeout(()=>{
                resolve();
            },3000)
            console.log(arguments)
        }
    }
}
</script>
```
:::

### attribute

| 名称 | 说明 | 备注 | 默认值|
|---------- |-------- |---------- |---------- |
| all-scroll | 是否整行都能拖拽 | -- | false |
| move-icon | 是否显示拖拽图标 | 为false 则整行拖拽 | true |
| position-icon | 拖拽图标位置 | begin：行首位 end：行末位 | begin |

### Methods

| 方法名称 | 说明 | 参数 | 返回值
|---------- |-------- |---------- |---------- |
| sortChange(ops)| 拖拽回调事件 | {resolve,reject,rowData,newIndex,oldIndex} | -- |
