博客
关于我
mui折叠面板点击事件跳转
阅读量:796 次
发布时间:2023-02-10

本文共 1029 字,大约阅读时间需要 3 分钟。

小编最近使用了MUI框架,体验良好。然而,官方文档中关于数据渲染的部分内容较为简略,导致点击事件的实现需要借助外部资源和学习。通过查询博客和借鉴他人经验,终于实现了点击事件的响应。

折叠面板的展示效果如下:通过将折叠面板所在的div赋予id,可以将数据绑定至li中。以下是实现的代码示例:

点击事件的实现如下:

mui('#workflow').on('tap', 'li', function(e) {    var id = this.getAttribute('id');    var key = this.getAttribute('key');    localStorage.setItem("id", id);    localStorage.setItem("key", key);    mui.openWindow({        url: 'addnewflow.html',        id: 'addnewflow',        extras: {            id: id        },        createNew: false,        show: {            autoShow: true,            aniShow: 'slide-in-right',            duration: 'animationTime'        },        waiting: {            autoShow: true,            title: '正在加载...',            options: {                width: 'waiting-dialog-widht',                height: 'waiting-dialog-height'            }        }    });});

这段代码实现了点击事件的响应,当折叠面板中的li元素被点击时,会将id和key存储到localStorage,并跳转至addnewflow.html页面。

转载地址:http://qlffk.baihongyu.com/

你可能感兴趣的文章
Mesos 资源分配
查看>>
Metasploit CGI网关接口渗透测试实战
查看>>
Metasploit SQL注入漏洞渗透测试实战
查看>>
Metasploit Web服务器渗透测试实战
查看>>
Metasploit Windows AD渗透测试实战
查看>>
MFC之处理消息映射的步骤...
查看>>
MFC对话框屏幕居中
查看>>
MFC工作笔记0011---atoi的用法
查看>>
MFC模态对话框和非模态对话框
查看>>
Miaoo朋友圈程序全完整版源码
查看>>
Milesight VPN server.js 任意文件读取漏洞(CVE-2023-23907)
查看>>
mockcpp & testngpp在2010.7~11月的改进
查看>>
Modbus RTU和Modbus TCP之间的区别
查看>>
Model-Based Reinforcement Learning(基于模型的强化学习)详解-ChatGPT4o作答
查看>>
module 'requests' has no attribute 'get' python
查看>>
Moment.js
查看>>
moment.js常见格式化处理各种时间方法
查看>>
Moment.js常见用法总结
查看>>
MongoDB与Mysql常用命令解释
查看>>
MongoDB出现Error parsing command line: unrecognised option ‘--fork‘ 的解决方法
查看>>