简体   繁体   English

Vue 如何添加电话号码通话链接

[英]Vue How to add phone number call link

In my vuejs -application, I have a table with some users which also includes a phone number.在我的vuejs ,我有一个包含一些用户的表,其中还包含一个电话号码。 Now I want to make the phone number clickable, but for some reason it does not work.现在我想让电话号码可点击,但由于某种原因它不起作用。

This is what I got:这是我得到的:

<router-link class="table-row" tag="div" v-for="entry in paginate(filteredData)" :key="entry.id" :to="routePath + entry.id">
   <div class="table-data" v-for="column in columns" v-bind:key="column.id" :class="column.key">
      <div v-if="column.key == 'phone'" :class="column.key">
         <span>
             <a href="tel:'`${entry[column.key]}`">{{entry[column.key]}}</a>
         </span>
      </div>
      <div v-else> 
        <span>{{entry[column.key]}}</span>
      </div>
   </div>
</router-link>

the result is <a href="/users/18/details">12448877</a> - which is the same route as the <router-link> - how can I achieve that the phone number gets displayed without using any plugin/package?结果是<a href="/users/18/details">12448877</a> - 与<router-link>路线相同 - 如何在不使用任何插件的情况下显示电话号码/包裹?

I think this line should be我认为这条线应该是

<a href="tel:'`${entry[column.key]}`">{{entry[column.key]}}</a>

like喜欢

<a :href="`tel:${entry[column.key]}`">{{entry[column.key]}}</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM