在用vue做移动端项目时,遇到店家跳转到拨号
<router-link active-class=‘sel’ tag=‘li’ to="" @click.native=‘gotel()’>
免费电话
methods:{
gotel(){
// console.log(1)
window.location.href = ‘tel:4008820666’
}
}
注意:在vue中给router-link添加事件需要加上.native
例如:@click.native
vue中移动端点击跳转到拨打电话页面
最新推荐文章于 2024-06-22 11:57:18 发布