1.2.0 • Published 3 years ago

vue2-draggable-tree v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

vue2-draggable-tree

A simple organization draggable tree chart based on Vue2.x

NPM

# use npm
npm i vue2-draggable-tree

# use yarn
yarn add vue2-draggable-tree

Import Plugins

import Vue from "vue";
import Vue2DraggableTree from "vue2-draggable-tree";
import "vue2-draggable-tree/dist/style.css"

Vue.use(Vue2DraggableTree);

// ...

API

props

propdescriptontypedefault
dataArray
defaultPropsconfigure propsObject{label: 'label', children: 'children', id: 'id'}
allowDragJudging which node can be draggedBooleantrue
horizontallayout is horizontalBooleanfalse
collapsablechildren node is collapsableBooleanfalse
expandAllchildren node is collapsable, and expand allBooleanfalse
labelClassNamenode label classFunction | String-
hoverClassNamenode label hover classFunction | String-
selectedClassNameThe className of the selected nodeFunction | String-

events

event namedescriptontype
node-clickTell you which node was clickedFunction
node-mouse-overonMouseOver eventFunction
node-mouse-outonMouseOut eventFunction

Call events

node-click

well be called when the node-label clicked

  • params model node data was clicked
  • params component VNode data for the node was clicked

Example

  • default

    default

  • horizontal

    horizontal

Browser support

Use Flexible Box Layout!

IE9+、Chrome、Firefox、Opera

License

MIT

1.2.0

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago