mui开发app知识点总结

一、mui-scroll做导航滚动  

需要手动初始化

$('.mui-scroll-wrapper').scroll({
	 bounce: false,
	 indicators: true, //是否显示滚动条
	 deceleration: deceleration
});

页面中使用了vue时,初始化滚动要在mounted 中。

二、模拟点击分类导航(分类导航页面在关闭的时候做了隐藏而不是销毁,下次再打开的时候需要模拟点击选中第一个分类)

//模拟点击第一个导航
mui.trigger(document.getElementsByClassName("firstNav")[0],'touchstart');
mui.trigger(document.getElementsByClassName("firstNav")[0],'tap');

三、mui-popover 弹窗中overflow: hidden; 不能滚动的问题

mui.js中阻止了mui-popover中的touch-move事件,处理掉就行了

var onPopoverShown = function(e) {
        this.removeEventListener('webkitTransitionEnd', onPopoverShown);
        // 发现说是mui.js将popover里的touchmove事件给拦截了,所以内容是不允许滑动(滚动),注释掉下面这行就好了  
        // this.addEventListener($.EVENT_MOVE, $.preventDefault);
        $.trigger(this, 'shown', this);
    }

猜你喜欢

转载自blog.csdn.net/fanhu6816/article/details/102787866
今日推荐