实现移动端拨打电话比较简单,其原理就是一个跳转的方式,跳转到我们的手机拨打页面
基本代码:
<el-button type="danger" @click="callPhone">110</el-button>
const phoneNumber = '110';
const callPhone = () => {
window.location.href = `tel:${phoneNumber}`;
};
实现移动端拨打电话比较简单,其原理就是一个跳转的方式,跳转到我们的手机拨打页面
<el-button type="danger" @click="callPhone">110</el-button>
const phoneNumber = '110';
const callPhone = () => {
window.location.href = `tel:${phoneNumber}`;
};