Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

树形目录默认折叠 #12

Open
hwj911327 opened this issue Sep 4, 2019 · 1 comment
Open

树形目录默认折叠 #12

hwj911327 opened this issue Sep 4, 2019 · 1 comment

Comments

@hwj911327
Copy link

希望左侧的树形导航栏默认是折叠上的

@zelluo
Copy link

zelluo commented Sep 20, 2019

我是这样解决的
在/vendor/weiwei/api-doc/src/view/index.html
106行页面加载ajax请求成功之后的success中
zTree = $.fn.zTree.init($("#zt_navi_tree"), setting, zNodes);
// 后面增加
var nodes = zTree.getNodes();
if (nodes.length > 0) {
for (var i = 0, len = nodes.length; i < len; i++) {
zTree.expandNode(nodes[i], false, false, false);
}
}
看代码这个左侧树形导航栏用的是zTree.js 看官方文档就可以
主要的是这个 zTree.expandNode()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants