vue-draggable-nested-tree
This is a draggable tree component. This component does not have css, you need to add your style refer to demo. The demo style is less, not difficult. This component doesn't render node. It exposes a node rendering slot. Please refer to the demo for rendering.
install
usage
import
data
template
template for old browsers(eg: IE)
api
The 'store' is the tree vm
Tree props
Noraml - Tree props
Hooks - Tree props
draggableHelperInfo
{event, options, store}
Tree properties
Tree events
- targetTree and oldTree are tree vm.
- oldTree is available only when cross tree. Otherwise null.
- if cross tree, both targetTree and oldTree will emit drop and change.
Tree methods
node properties
node deep properties example
other
demo css
examples
clone the package, and
draggable & droppable
A node is default draggable and droppable. You can set draggable and droppable property of a node. The another way is listen event 'drag', traverse all data to set draggable or droppable property.
Traverse tree
Recommend to use my other library tree-helper. It has 2 traverse methods: depthFirstSearch, breadthFirstSearch.
draggable library
draggable-helper is my another library for drag. And it also is using by this component. You can use it to help you drag functions.