Angular可拖动表格指令 - angular-dragtable

Angular可拖动表格指令 - angular-dragtable
插件名称 angular-dragtable
发布时间 2020年8月26日
插件作者 maliMirkec

AngularJS指令,允许您通过拖放来对表列进行重新排序。

安装:

# NPM
$ npm install angular-dragtable

# Bower
$ bower install angular-dragtable

用法

首先在项目中包含Angular Dragtable:

(function (DemoApp) {
          'use strict';

          DemoApp = angular.module('DemoApp', ['Dragtable']);

          DemoApp.config(function () {});
        }(this));

要允许列重新排序,请添加伪指令drag-medrop-meon th元素,如下所示:

<table>
  <thead>
    <tr>
      <th>ID</th>
      <th drag-me drop-me>Name</th>
      <th drag-me drop-me>Description</th>
      <th drag-me drop-me>Age</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>Item 1</td>
      <td>Description 1</td>
      <td>1</td>
    </tr>
    ...
  </tbody>
</table>