今天用vue项目给mui的选项卡绑定click事件,在chrome里手机模式没问题,但手机上用qq自带浏览器打开就点击无效,uc里面有效

<div class="mui-segmented-control" >
	<a class="mui-control-item mui-active" @click="change(1)">
		<img src="images/ff.png" alt="">
		移动套餐
	</a>
	<a class="mui-control-item" @click="change(2)">
		<img src="images/vv.png" alt="">
		联通套餐
	</a>
	<a class="mui-control-item" @click="change(3)">
		<img src="images/bbf.png" alt="">
		电信套餐
	</a>
</div>

解决方法:

将click事件改成tap事件

mui('body').on('tap','a',function(){document.location.href=this.href;});

<div class="mui-segmented-control" >
	<a class="mui-control-item mui-active" @tap="change(1)">
		<img src="images/ff.png" alt="">
		移动套餐
	</a>
	<a class="mui-control-item" @tap="change(2)">
		<img src="images/vv.png" alt="">
		联通套餐
	</a>
	<a class="mui-control-item" @tap="change(3)">
		<img src="images/bbf.png" alt="">
		电信套餐
	</a>
</div>

 

Logo

前往低代码交流专区

更多推荐