vue横向树结构_Vue中使用ztree实现树形结构

Vue中使用ztree实现树形结构

发布时间:2018-08-30 14:25,

浏览次数:1272

, 标签:

Vue

ztree

* 官网链接 点击这里 ,

*

效果图

*

后端返回数据结构为Object

*

html部分:

'onchangeDept' size="small" @focus="showDept" suffix-icon="el-icon-search">

el-input>

"isShowDept">

"departTree userTree">

:showOperIcon="showOperIcon" :dataConfig="zTreeDataConfig" :isDrag="zTreeIsDrag"

@clickNode="clickDepartNode">

* 初始化必要数据

* method //搜索所属部门 onchangeDept:function(value){ this.showDept(); }, // 查询部门树

showDept(){var that = this; that.isShowDept =true; var param = {

searchVal:that.form.depname, token:that._logintoken, };

getDepSubTreeList({queryStr:JSON.stringify(param)},that._logintoken).then(

function(res){ console.log("getDepSubTreeList+++++=========",res); if

(res.STATUS="success" && res.RESULT!=null){ that.zTreeData = res.RESULT; }

}).catch(function (err) { }); }, //双击选中节点 clickDepartNode:function (event,

treeId, treeNode, clickFlag) { console.log("treeNode--",treeNode); this

.isShowDept =false; this.form.depid = treeNode.id; this.form.depname =

treeNode.depname; },

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值