小程序vant popup弹出层阻止底层页面滑动

前言

在小程序编写过程中使用使用vant weapp的popup组件做小程序的弹出层,触屏导致底层页面跟着滑动。

解决方法

使用touch事件阻止属性,@touchmove.stop.prevent指向空事件
van-popup(
	:show="popupShow"
	:z-index="999"
	position="bottom"
	@close="popupClose"
	@touchmove.stop.prevent="moveHandle")
 
 methods: {
 	 moveHandle () {}
 

}

猜你喜欢

转载自blog.csdn.net/weixin_48193717/article/details/107922097