1.2.2 • Published 6 years ago

vue-sortable-tree v1.2.2

Weekly downloads
141
License
ISC
Repository
github
Last release
6 years ago

vue-sortable-tree

npm

Demo Link

Demo Link Source Code

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 --save

Global 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>
PropertyTypeDefaultDescription
dataObject-Tree data source.
attrString'name'A name of property in data source that will be display.
childrenAttrStringchildrenA name of property in data source that contain children node.
mixinParentKeyString''A name of property that contain parent data.
closeStateKeyString''A name of property to determine the open/close state.
draggableBooleantrueEnable dragging the tree node.
EventParameterDescription
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-dev

Project demo image

img

You can design your style easily with custom template.

eg:

img

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.26

7 years ago

1.0.25

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago