前端拨号的方法

前端拨号的方法

徐徐
前端
发布于2024-08-20 16:35:37
🌺前言
移动端唤起拨号等功能

html
index.html在<head></head>中加入这一段
<meta name="format-detection" content="telephone=yes"/>

js
callPhone () { //创建一个方法
  window.location.href = 'sms:10086?body=短信内容'; // 添加内容
  window.location.href = 'sms:10086'; // 不添加内容
}

html
<a href="sms:10086">发送短信</a>
<a href="sms:10086?body=短信内容"></a>
<a :href="'mailto:' + numbers">{{ numbers }}</a> //numbers 就是号码
文章最后更新于 2024-08-20 16:35:37
留言
暂无数据

~~空空如也