ztree只有最后一个节点显示的坑!
2020-11-19 本文已影响0人
沧澈
在项目中用ztree的时候发现只有最后一个父节点有数据,其他父节点的子节点数据加载不出来。

检查数据结构后没有发现问题,查找文档+百度发现,设置view.showLine=false;就能够正常显示,应该是ztree插件的bug。

代码如下:
view = {
dblClickExpand: true,
fontCss:getFontCss,
expandSpeed: "fast",
showLine: false, // 加上这行代码
};
查阅官方文档,showLine: false的作用是设置 zTree 是否显示节点之间的连线。
