1.0.2 • Published 3 years ago

vue-tree-plugin v1.0.2

Weekly downloads
12
License
ISC
Repository
github
Last release
3 years ago

A Vue.js Tree Plugin

Support

  • Vue.js framework version:2.x

Installation

npm i vue-tree-plugin

Usage

Configuartion

you need to import plugin in your main.js

import Vue from "vue";
import vueTree from "vue-tree-plugin";
Vue.use(vueTree);
<vue-tree-plugin/>

Props

nametypedescription
datarequired:Array<NodeItem>data to render Tree
  • NodeItem
{
    iconClass: String,//the className of font icon that we want to dispaly about this node,egg:"iconfont icon-editor"
    name: String,//name of node we want to display
    desc: String,//description of node we want to display
    isLeaf: Boolean,// we can click arrow icon to expand a leaf node's children nodes
    children: Array<NodeItem>,//
}

Events

nameparamsdescription
onNodeClicktarget node 's position,eg:0-0-1when a node has been clicked
onAppendBtnClicktarget node 's positionwhen add icon button has been clicked
onDeleteBtnClicktarget node 's positionwhen delete icon button has been clicked
onModifyBtnClicktarget node 's positionwhen edit icon button has been clicked

Examples

you can checkout Demo here