mui框架中onclick或@click事件在某些浏览器中失效
今天用vue项目给mui的选项卡绑定click事件,在chrome里手机模式没问题,但手机上用qq自带浏览器打开就点击无效,uc里面有效<div class="mui-segmented-control" ><a class="mui-control-item mui-active" @click="cha
·
今天用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>
更多推荐
已为社区贡献4条内容
所有评论(0)