当前位置:网站首页>【若依(ruoyi)】ztree 自定义图标(iconSkin 属性)
【若依(ruoyi)】ztree 自定义图标(iconSkin 属性)
2022-07-06 02:41:00 【sayyy】
前言
- ruoyi 4.6.0
- JQuery zTree core 3.5.12
创建 iconSkin
.ztree li span.button.ico2_ico_open{
margin-right:2px; background-position: -147px -21px; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico2_ico_close{
margin-right:2px; margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico2_ico_docu{
margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
.ztree li span.button.ico2_ico_open:支节点展开状态的样式.ztree li span.button.ico2_ico_close:支节点折叠状态的样式.ztree li span.button.ico2_ico_docu:叶子节点的样式.ztree li span.button.<iconSkin 名称>_ico_open:<iconSkin 名称>可自定义iconSkin ico2:.ztree li span.button.ico2_ico_docu的图标设置成与.ztree li span.button.ico2_ico_close的图标一致
使用iconSkin方式1:
var setting = ...;
//js中节点数据:
var zTreeNodes = [
//父节点展开 折叠时使用相同的图标
{
name:"父节点1", iconSkin:"diy01"},
//父节点展开 折叠时分别使用不同的图标
{
name:"父节点2", iconSkin:"diy02"},
//叶子节点个性化图标
{
name:"叶子节点", iconSkin:"diy03"}
];
//zTree 初始化
$.fn.zTree.init($("#tree"), setting, zTreeNodes);
使用iconSkin方式2:
var treeObj = $.fn.zTree.getZTreeObj("tree");
var treeNodes = treeObj.transformToArray(treeObj.getNodes());
treeNodes.forEach(treeNode => {
if (!treeNode.isParent) {
/* 将叶子节点的iconSkin设置为:ico2 */
treeNode.iconSkin = "ico2";
treeObj.updateNode(treeNode);
}
});
参考
https://treejs.cn/v3/api.php
边栏推荐
- 07 singleton mode
- Pat grade a 1033 to fill or not to fill
- HDU_ p1237_ Simple calculator_ stack
- Bigder:34/100 面试感觉挺好的,没有收到录取
- 数据准备工作
- 剑指 Offer 29. 顺时针打印矩阵
- 有沒有sqlcdc監控多張錶 再關聯後 sink到另外一張錶的案例啊?全部在 mysql中操作
- Briefly describe the implementation principle of redis cluster
- Easy to use js script
- Zero foundation self-study STM32 - Review 2 - encapsulating GPIO registers with structures
猜你喜欢

Qt发布exe软件及修改exe应用程序图标
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22](/img/e0/21367eeaeca10c0a2f2aab3a4fa1fb.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22

"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers

Httprunnermanager installation (III) - configuring myql Database & initialization data under Linux

RobotFramework入门(一)简要介绍及使用

微服务注册与发现
![[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation](/img/e4/890e84ab8326e029c4915163904d85.jpg)
[Digital IC manual tearing code] Verilog asynchronous reset synchronous release | topic | principle | design | simulation
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20](/img/d5/4bce239b522696b5312b1346336b5f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20

零基础自学STM32-野火——GPIO复习篇——使用绝对地址操作GPIO
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9](/img/ed/0edff23fbd3880bc6c9dabd31755ac.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
随机推荐
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers
解决:AttributeError: ‘str‘ object has no attribute ‘decode‘
Six stone management: why should leaders ignore product quality
How to improve the enthusiasm of consumers when the member points marketing system is operated?
Introduction to robotframework (I) brief introduction and use
一个复制也能玩出花来
事故指标统计
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
Elimination games
PMP practice once a day | don't get lost in the exam -7.5
Template_ Find the reverse pair of permutations_ Sort based on merge
Day 50 - install vsftpd on ceontos6.8
Trends in DDoS Attacks
微服务注册与发现
Easy to use js script
JS events (add, delete) and delegates
C语言sizeof和strlen的区别
米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
微软语音合成助手 v1.3 文本转语音工具,真实语音AI生成器
技术分享 | undo 太大了怎么办