Tempate:
<a href="sms:10086?body=888" @click="infoClick($event)">拉起短息发送</a>
methods:
infoClick(e) {
// 触发手机自带发短信,上面的代码只适用于Android,当为ios时需要将上面的?改为&
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
if(isiOS){
var hr = e.target.getAttribute('href')
hr = hr.replace("?","&");
e.target.setAttribute("href",hr);
}
},