Angular 触摸式可排序组件-ngx-hm-sortable

Angular 触摸式可排序组件-ngx-hm-sortable
插件名称 ngx-hm-sortable
发布时间 2020年7月7日
插件作者 ZouYouShun

支持服务器端渲染的Angular 5+拖放式可排序组件。

安装:

# NPM
$ npm install ngx-hm-sortable --save

用法:

<table>
  <tbody
    [ngx-hm-sortable]="list"
    elms-selector=".item"
    move-selector=".drag"
    selected-class="color-blue"
    moving-class="color-red"
    (sort-complete)="complete($event)">
    <tr>
      <th>sortable</th>
      <th>number</th>
    </tr>
    <tr *ngFor="let item of list; let i = index;" [attr.index]="i" class="item">
      <td>
        <span class="drag">dragMe!</span>
      </td>
      <td>{{item}}</td>
    </tr>
  </tbody>
</table>