×

vue移动项目中如何设置点击手机号码就唤起拨号功能

作者:cidy20172020.11.27来源:Web前端之家浏览:11864评论:0
关键词:jsvue

vue移动项目中如何设置点击手机号码就唤起拨号功能。

<p>联系电话:<a :href="'tel:' + item.phone" rel="external nofollow" >{{item.phone}}</a></p>

1、在vue项目的index.html中添加如下代码:

<meta name="format-detection" content="telephone=yes" />

2、在需要调起手机拨号功能的页面,写如下函数:

// 调用拨号功能
callPhone (phoneNumber) {
 window.location.href = 'tel://' + phoneNumber
}

3、在需要调用的地方,调用此函数,传入对应的手机号码。

另外,还可以通过android 调用Intent来实现,百度有很多,就不举例了。

您的支持是我们创作的动力!
温馨提示:本文作者系 ,经Web前端之家编辑修改或补充,转载请注明出处和本文链接:
https://www.jiangweishan.com/article/js20201127a3342.html

网友评论文明上网理性发言 已有0人参与

发表评论: