美文网首页
mui组件js API 转载dcloud.io

mui组件js API 转载dcloud.io

作者: 还是磊哥 | 来源:发表于2016-12-11 14:06 被阅读0次

    mui组件JS API

    变量类型判断:mui.type()

    var a = [];
    var b = {};
    var c = '{"name":"zhaomenghuan","age":22}';
    
    console.log("a:" + mui.type(a)); // array
    console.log("b:" + mui.type(b)); // string
    console.log("c:" + mui.type(c)); // string 
    

    获取当前时间戳:mui.now()

    mui.now();
    

    解析的JSON字符串:mui.parseJSON(String)

    var jsonStr = '{"name":"mui","version":"3.3.0"}';
    var obj = mui.parseJSON(jsonStr);
    console.log("name:" + obj.name);
    

    offcanvas侧滑导航监听事件

    document.querySelector('.mui-off-canvas-wrap').addEventListener('shown', function () {
        console.log("show");
    })      
    document.querySelector('.mui-off-canvas-wrap').addEventListener('hidden', function () {
        console.log("hidden");
    })
    

    相关文章

      网友评论

          本文标题:mui组件js API 转载dcloud.io

          本文链接:https://www.haomeiwen.com/subject/jokpmttx.html