Vue-awesome-swiper: 设置垂直全屏,全屏无效

Created on 14 Sep 2017  ·  2Comments  ·  Source: surmon-china/vue-awesome-swiper

swiper 超出一屏幕不能出现滚动条,找到解决方案是

var swiper = new Swiper('.swiper-container', {
    direction: 'vertical',
});
var startScroll, touchStart, touchCurrent;
swiper.slides.on('touchstart', function (e) {
    startScroll = this.scrollTop;
    touchStart = e.targetTouches[0].pageY;
}, true);
swiper.slides.on('touchmove', function (e) {
    touchCurrent = e.targetTouches[0].pageY;
    var touchesDiff = touchCurrent - touchStart;
    var slide = this;
    var onlyScrolling = 
            ( slide.scrollHeight > slide.offsetHeight ) && //allow only when slide is scrollable
            (
                ( touchesDiff < 0 && startScroll === 0 ) || //start from top edge to scroll bottom
                ( touchesDiff > 0 && startScroll === ( slide.scrollHeight - slide.offsetHeight ) ) || //start from bottom edge to scroll top
                ( startScroll > 0 && startScroll < ( slide.scrollHeight - slide.offsetHeight ) ) //start from the middle
            );
    if (onlyScrolling) {
        e.stopPropagation();
    }
}, true);

但是vue-awesome-swiper 无入口传递事件传递的顺序(true 和false),在Vue组件下失效,求解决方案

Most helpful comment

下次记得把代码格式化再贴出来。

All 2 comments

下次记得把代码格式化再贴出来。

hello . 请问这个问题找到解决办法了吗?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tbcinteractive picture tbcinteractive  ·  6Comments

arpagrawal picture arpagrawal  ·  6Comments

baokuanze picture baokuanze  ·  5Comments

tilight picture tilight  ·  5Comments

Bobur-kobilov picture Bobur-kobilov  ·  5Comments