之前以为是mui禁用了某些事件,先将mui的css和Js删除,可是也不行;
后来想到是不是打包后出问题了,所以就使用内网穿透来测试!
结果是 图片轮播是没问题,但是缩放就不行!,在移动端双击也是不可以的
<script>
/*组件方式引用*/
import 'swiper/dist/css/swiper.css'////这里注意具体看使用的版本是否需要引入样式,以及具体位置。
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
name: "detail",
components: {swiper, swiperSlide},
data() {
return {
swiperOption: {
zoom: {
maxRatio: 10, //最大倍数
minRatio: 2, //最小倍数
toggle: true, //不允许双击缩放,只允许手机端触摸缩放。
},
},
};
},
computed: {
swiper() {
return this.$refs.mySwiper.swiper
}
},
mounted() {
console.log(this.swiper.zoom.enabled);
console.log(this.swiper.zoom.scale);
this.swiper.slideTo(3, 1000, false)
}
}
</script>