MUI框架常用代码段

以下是个人整理的MUI框架常用代码段,仅供个人记录。

---------------------------------------------------------------------------------------
//双击标题返回顶部
mui.init({
    gestureConfig:{
       tap: true, //默认为true
       doubletap: true
    }
});
//单页面
mui('.mui-bar-nav').on('doubletap','.mui-title',function(){
    window.scrollTo(0, 0);
});
//包含子页面的方式-能直接获取子页面
mui('.mui-bar-nav').on('doubletap','.mui-title',function(){
    var    contentWebview = plus.webview.getWebviewById('index_sub');
    //内容区滚动到顶部
    contentWebview.evalJS("mui('#refreshContainer').pullRefresh().scrollTo(0,0,200)");
});
//包含子页面的方式-不能直接获取子页面
var contentWebview = null;
mui('.mui-bar-nav').on('doubletap','.mui-title',function(){
    if(contentWebview==null){
        contentWebview = plus.webview.currentWebview().children()[0];
    }
    //内容区滚动到顶部
    contentWebview.evalJS("mui('#refreshContainer').pullRefresh().scrollTo(0,0,200)");
});

---------------------------------------------------------------------------------------
//获取当前webview
var self = plus.webview.currentWebview();
//根据id查找webview
var    webview = plus.webview.getWebviewById('id');

---------------------------------------------------------------------------------------
//发送数据   webview,事件名称,{}格式数据
mui.fire(webview_page, 'get_detail', data);
//接收跳转查询参数
window.addEventListener('get_detail',function(e){
    e.detail.key;
    e.detail.value;
});

---------------------------------------------------------------------------------------
//创建原生窗口
var webviewStyle = {
    titleNView: {
        autoBackButton: true,
        backgroundColor: '#007aff',
        titleColor: '#FFFFFF',
        titleText: ''
    },
    scrollIndicator: 'none',
    scalable: false
};
//plus.webview.create() url,id,style,传参
var detail_page = plus.webview.create("sfdPro_detail.html", "sfdPro_detail",webviewStyle,param);
//接收参数
mui.plusReady(function(){
    var self = plus.webview.currentWebview();
    self.key;
    self.value;
});

----------------------------------------------------------------------------------------
//VUE数据绑定
var detail_List = new Vue({
    el:'#main_content',
    data:{rows:[]},
    methods:{
        resetData : function (){
            mui.extend(this.$data, {rows:[]});
        }
    }
});

-----------------------------------------------------------------------------------------
 <div id="sliderProgressBar" class="mui-slider-progress-bar mui-col-xs-3"></div>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值