vue-sort

1.0.1 • Public • Published

vue-sort

vue排序组件

依赖jquery

Install

npm install vue-sort --save-dev

Example

import VueSort from 'vue-sort'
new Vue({
    el: '.drag-container',
    data: {
        list: [{
            index: 0
        }, {
            index: 1
        }, {
            index: 2
        }]
    },
    ready: function() {
        var _this = this;
        new Sort('.drag-wrapper', {
            onMouseUp: function(s) {
                _this.list = s.sort(_this.list);
            }
        })
    }
});

自定义事件

Name Default Description
itemsClass v-sort-item 每个item的class
moveTransitionTime 0.3s animation时间

Callback

Name Description
onMouseDown 鼠标按下的回调
onMouseMove 鼠标移动的回调
onMouseUp 鼠标抬起的回调

Readme

Keywords

none

Package Sidebar

Install

npm i vue-sort

Weekly Downloads

3

Version

1.0.1

License

ISC

Last publish

Collaborators

  • braisedcakes