1.0.1 • Published 7 years ago

vue-sort v1.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

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);
            }
        })
    }
});

自定义事件

NameDefaultDescription
itemsClassv-sort-item每个item的class
moveTransitionTime0.3sanimation时间

Callback

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