开发方式
代码开发
可视化开发
代码仓库
AI助手
UTCms
UTForum
文档有错误?发信:usualtool@qq.com
定位至目录
模板语法套用html产物示例 <{item=>$module,$backitem}> <{datatree=>2,...}>
css示例 /* ===== item 系:Column 下拉 ===== */ .ut-item-menu{position:relative;display:inline-block;} .ut-item-link{cursor:pointer;user-select:none;} /* 面板默认隐藏,右对齐向左展开(防页面右缘溢出) */ .ut-item-menu-small{display:none;position:absolute;right:0;top:100%;z-index:1000; min-width:8rem;padding:.5rem 0;margin:.125rem 0 0;background:#fff; border:1px solid rgba(0,0,0,.15);border-radius:.25rem; box-shadow:0 .5rem 1rem rgba(0,0,0,.175);} .ut-item-menu.show .ut-item-menu-small{display:block;} /* 条目:官方拼写就是 samll,顺手兼容正确拼写 small */ .ut-item-menu-small .ut-item-link-samll, .ut-item-menu-small .ut-item-link-small{display:block;width:100%;padding:.25rem 1rem; clear:both;font-weight:400;color:#212529;text-align:left; text-decoration:none;white-space:nowrap;background:none;border:0;} .ut-item-menu-small .ut-item-link-samll:hover, .ut-item-menu-small .ut-item-link-small:hover{color:#16181b;text-decoration:none;background:#f8f9fa;} /* ===== tree 系:树形行(左名称右按钮) ===== */ .ut-tree-menu{display:flex;align-items:flex-start;justify-content:space-between; margin-bottom:15px;font-size:14px;} /* 名称区弹性伸展:$spacer 层级缩进天然保留,长名称省略号不挤压按钮 */ .ut-tree-left{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;} .ut-tree-right{flex:0 0 auto;white-space:nowrap;} .ut-tree-right a{color:#6c757d;text-decoration:none;} .ut-tree-right a:hover{color:#212529;text-decoration:underline;}
模块子菜单js示例 // 点击触发字:互斥开关本菜单 $(document).on("click",".ut-item-link",function(e){ e.stopPropagation(); var $menu=$(this).closest(".ut-item-menu"); $(".ut-item-menu.show").not($menu).removeClass("show"); $menu.toggleClass("show"); }); // 点击菜单内链接:先收起再跳转 $(document).on("click",".ut-item-menu-small a",function(){ $(this).closest(".ut-item-menu").removeClass("show"); }); // 点击页面其它位置:全部收起 $(document).on("click",function(){ $(".ut-item-menu.show").removeClass("show"); }); // ESC:全部收起 $(document).on("keydown",function(e){ if(e.key==="Escape"){$(".ut-item-menu.show").removeClass("show");} });
始于2018年,UT框架版权归原作者所有 开放、包容、发展。 工单 | 团队 | 蜀ICP备2024067013号