在vue.js中实现a标签href tel的打电话功能
-
div v-for="p in persons">
-
<p>
-
name: {{ p.name }}
-
</p>
-
<p>
-
//正确做法,拼接字符串
-
tel: <a :href="'tel:' + p.phone">call me</a>
-
</p>
-
</div>
-
persons: [
-
{
-
name: 'arron',
-
phone: 13811112222
-
},{
-
name: 'jack',
-
phone: 13900088822
-
},{
-
name: 'steven',
-
phone: 13711119909
-
}
-
]
-
//遍历persons,实现tel功能