swiper4.5.1 在移动端缩放图片, 手指缩放无效

宋小米love666
  • 0
新手上路,请多包涵
<template>
<div class="image-preview">
    <div class="swiper-container"  ref="mySwiper">
        <div class="swiper-wrapper">
            <div v-for="(item, index) in imageList" :key="index" class="swiper-slide">            
                <div class="swiper-zoom-container">
                    <img :src="item"/>
                </div>
            </div>
        </div>
        <div class="swiper-pagination swiper-pagination-customer" slot="pagination" style="text-align:left"></div>
    </div>
</div>    
</template>
<script>
import "swiper/dist/css/swiper.css";
import Swiper from 'swiper'
export default {
    name: 'imagePreview',
    //components: { swiper, swiperSlide },
    props: {
        imageList: {
            type: Array,
            default: () => []
        },
        imageSlide: {
            type: Number,
            default: () => 0
        }
    },
    data () {
        return {}
    },
    mounted() {
        const mySwiper = new Swiper('.swiper-container', {
                width: window.innerWidth,
                zoom: true,
                initialSlide: this.imageSlide,
                 // 显示分页
                pagination: {
                    type: 'fraction',
                    el: ".swiper-pagination",
                    clickable: true, //允许分页点击跳转
                    currentClass: 'swiper-pagination-current-cutomer',
                    totalClass: 'swiper-pagination-total-customer'
                },
                on:{
                    click: () => {
                        this.exitImgPreview()
                    }
            }
        })
    },
    methods: {
        exitImgPreview() {
            this.$emit('exitImgPreview')
        }
    }
}

代码如上,在移动端点击可以放大图片,手指触摸缩放没有效果,有大神遇到过这个问题吗?求解答一下

回复
阅读 181
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
你知道吗?

宣传栏