当前位置:网站首页>【若依(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
边栏推荐
- Structural theme model (I) STM package workflow
- 解决:AttributeError: ‘str‘ object has no attribute ‘decode‘
- Referenceerror: primordials is not defined error resolution
- I changed the driver to 5.1.35, but it is still the same error. I can succeed even now, but I will report this every time I do an SQL operation
- 一位博士在华为的22年
- 2345 file shredding, powerful file deletion tool, unbound pure extract version
- Ue4- how to make a simple TPS role (II) - realize the basic movement of the role
- 模板_求排列逆序对_基于归并排序
- Introduction to robotframework (I) brief introduction and use
- 纯Qt版中国象棋:实现双人对战、人机对战及网络对战
猜你喜欢
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

LeetCode 103. Binary tree zigzag level order transverse - Binary Tree Series Question 5
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7](/img/44/1861f9016e959ed7c568721dd892db.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 7

米家、涂鸦、Hilink、智汀等生态哪家强?5大主流智能品牌分析
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10](/img/89/1c2f98973b79e8d181c10d7796fbb5.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10

Microsoft speech synthesis assistant v1.3 text to speech tool, real speech AI generator

Master data management theory and Practice

Zero basic self-study STM32 wildfire review of GPIO use absolute address to operate GPIO
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15](/img/72/0fe9cb032339d5f1ccf6f6c24edc57.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 15

微服务注册与发现
随机推荐
主数据管理(MDM)的成熟度
Elimination games
A doctor's 22 years in Huawei
PAT甲级 1033 To Fill or Not to Fill
After changing the GCC version, make[1] appears in the compilation: cc: command not found
MySQL winter vacation self-study 2022 11 (5)
剑指 Offer 29. 顺时针打印矩阵
Deeply analyze the chain 2+1 mode, and subvert the traditional thinking of selling goods?
How to improve the enthusiasm of consumers when the member points marketing system is operated?
大厂镜像库
2022 China eye Expo, Shandong vision prevention and control exhibition, myopia, China myopia correction Exhibition
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
Yyds dry inventory comparison of several database storage engines
3D drawing ()
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
inherited constructors
Template_ Quick sort_ Double pointer
Advanced technology management - what is the physical, mental and mental strength of managers
Sword finger offer 29 Print matrix clockwise
Sword finger offer 30 Stack containing min function