1.2.2 • Published 7 years ago
vue-sortable-tree v1.2.2
vue-sortable-tree
QQ交流群: 424580388
Install
vue version < 2.5
$ npm install vue-sortable-tree@1.1.0 --save [must < 1.2.0]vue version >= 2.5
$ npm install vue-sortable-tree --saveGlobal register
import SortableTree from 'vue-sortable-tree'
Vue.component(SortableTree.name, SortableTree)Partial register
import SortableTree from 'vue-sortable-tree'
// then in component
components: {
[SortableTree.name]: SortableTree
}Usage
<template>
<sortable-tree :data="treeData">
<template slot-scope="{item}">
<span>{{item.name}}</span>
</template>
</sortable-tree>
</template>Params
<sortable-tree :data="treeData" attr="name" childrenAttr="children" mixinParentKey="$parent" @changePosition="changePosition">
<template slot-scope="{item}">
<span>{{item.name}}</span>
</template>
</sortable-tree>| Property | Type | Default | Description |
|---|---|---|---|
data | Object | - | Tree data source. |
attr | String | 'name' | A name of property in data source that will be display. |
childrenAttr | String | children | A name of property in data source that contain children node. |
mixinParentKey | String | '' | A name of property that contain parent data. |
closeStateKey | String | '' | A name of property to determine the open/close state. |
draggable | Boolean | true | Enable dragging the tree node. |
| Event | Parameter | Description |
|---|---|---|
changePosition | {beforeParent, data, afterParent} | Trigger when node position has been changed. |
依赖 sassscss support
if your project can't support scss please add below dependence
npm install node-sass --save-dev
npm install sass-loader --save-devProject demo image

You can design your style easily with custom template.
eg:

1.2.2
7 years ago
1.2.1
8 years ago
1.2.0
8 years ago
1.1.0
8 years ago
1.0.26
8 years ago
1.0.25
8 years ago
1.0.23
8 years ago
1.0.22
8 years ago
1.0.21
8 years ago
1.0.20
8 years ago
1.0.19
8 years ago
1.0.18
8 years ago
1.0.17
8 years ago
1.0.16
8 years ago
1.0.15
8 years ago
1.0.14
8 years ago
1.0.13
8 years ago
1.0.12
8 years ago
1.0.10
8 years ago
1.0.9
8 years ago
1.0.7
9 years ago
1.0.6
9 years ago
1.0.5
9 years ago
1.0.4
9 years ago
1.0.3
9 years ago
1.0.2
9 years ago
1.0.1
9 years ago
1.0.0
9 years ago