项目作者: sharedlabs

项目描述 :
A web component for reorderable drag-and-drop lists on modern browsers and touch devices.
高级语言: HTML
项目地址: git://github.com/sharedlabs/sortable-list.git
创建时间: 2016-10-01T11:40:45Z
项目社区:https://github.com/sharedlabs/sortable-list

开源协议:MIT License

下载


License
Published on webcomponents.org

Demo and API docs

GIF

sortable-list

sortable-list is a custom element that allows you to sort an element from a list by dragging it.

  1. <sortable-list on-sort-finish="_onSortFinish" dragging="{{dragging}}">
  2. <div>Item 1</div>
  3. <div>Item 2</div>
  4. <div>Item 3</div>
  5. </sortable-list>
  6. ...
  7. onSortFinish(event) {
  8. const sortedItem = event.detail.target;
  9. }

When using a dom-repeat you must specify which items are sortable.

  1. <sortable-list sortable=".item">
  2. <dom-repeat>
  3. <div class="item"></div>
  4. </dom-repeat>
  5. </sortable-list>

TODO:

  • Allow sort of elements with different sizes #2