# Sortable

表格排序显示隐藏组件

## 用法
数据以一下格式传入
```html
<data-grid :model='model' :thumb-width="16"  @add-or-remove="scroll" v-ref:grid>
  <template partial='head' >
    <tr>
      <th class="stickToLeft text-center">序号</th>
      <th v-for="col in $parent.$parent.obj" v-show="col.show">{{col.name}}</th>
      <th class="stickToRight text-center"><sortable :data="$parent.$parent.obj"></sortable></th>
    </tr>
  </template>
  <template partial='body'>
    <td class="stickToLeft">{{$index + 1}}</td>
    <td v-for="col in $parent.$parent.obj" v-show="col.show">{{row[col.column]}}</td>
    <td class="stickToRight text-center" style="background: #FFF;"></td>
  </template>
</data-grid>
```
```
obj: [
  {column: 'test1', name: '测试一', show: true},
  {column: 'test2', name: '测试二', show: true},
  {column: 'test3', name: '测试三', show: true},
  {column: 'test4', name: '测试四', show: true},
  {column: 'test5', name: '测试五', show: true}
]
```

鼠标点击不放拖动元素到目标位置

## 事件
order 拖动排序后发出，携带排序好的数据
add-or-remove 点击显示与隐藏发出，携带点击行对象

## 测试用例

请参考Sorttable测试用例。
