layui tree 加载慢_LayUi树形组件tree实现懒加载模式,展开父节点时异步加载子节点数据...

本文展示了如何使用layui的tree组件实现懒加载功能,当展开父节点时,异步加载子节点数据,提高页面性能。示例代码详细说明了配置和事件处理,包括点击和展开节点时的回调函数。
摘要由CSDN通过智能技术生成

DOCTYPE html>

title>

script>

script>

script>

script>

}.demo-tree-box{width:500px;height:200px;border:1px #eee solid;overflow-y:auto;

}.demo-input-tree{height:auto;width:100%;display:none;position:absolute;top:100%;background-color:#fff;z-index:100;max-height:400px;

}.layui-input{width:500px;cursor:pointer;

}

style>

head>

部门:label>

div>

div>

i>button>

div>

div>

div>

i>获取选中button>

i>设置节点勾选button>

i>实例重载button>

div>

div>

div>

div>

div>

Copyright©2019-2020, 本系统由@一如既往,提供技术支持!blockquote>

div>

div>

body>

//初始化

layui.use(['tree'],function() {vartree=layui.tree;//treeid

varinst1=tree.render({

elem:'#treeid',

id:'treeid',//定义索引

showCheckbox:true,//是否显示复选框

showLine:true,//是否开启连接线。默认 true,若设为 false,则节点左侧出现三角图标。

accordion:false,//是否开启手风琴模式,默认 false

onlyIconControl:false,//是否仅允许节点左侧图标控制展开收缩。默认 false

isJump:false,//是否允许点击节点时弹出新窗口跳转。默认 false

data: [{

id:'hg-100',

field:'1&#

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值