1.0.6 • Published 7 years ago
v2-tree v1.0.6
vue-tree
先来看下效果图
安装
$ npm install v2-tree引入方式
import Tree from "v2-tree"
const Tree = require("v2-tree");
<script src="./dist/tree.js"></script>API
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| sources | 数据结构 | Array | [] |
| handleClick | 单击节点的回调函数 | Function(data,parent,index) | - |
| handleDblclick | 双击节点的回调函数 | Function(data,parent,index) | - |
| handleAdd | 添加节点的回调函数,注意如果是自定义弹框(showModal),此回调无效 | Function({params, obj, closeModalCallback}) | - |
| handleEdit | 更改节点的回调函数,注意如果是自定义弹框(showModal),此回调无效 | Function({params, obj, closeModalCallback}) | - |
| handleRemove | 删除节点的回调函数 | Function(data, parent, index) | - |
| handleShowModal | 显示自定义添加节点弹框回调函数,必须要有具名插槽slot="modal", type=add|edit | Function(type, data, parent, index) | - |
| slot | 具名插槽,请看slot用法 | - | - |
Slot
适用于自定义添加弹框节点
| 名称 | 说明 |
|---|---|
| modal | 自定义添加弹框 |