【问题标题】:dynamic href call tag ionic 3 app动态 href 调用标签 ionic 3 app
【发布时间】:2018-10-16 21:23:14
【问题描述】:

我正在尝试向我的 Ionic 3 应用程序添加一个 href 调用操作。我将电话号码存储在绑定{{item.phone}}

我需要将此添加到 href 标记才能打开手机本机应用程序。我不知道如何将它绑定到 href 标签

<ion-col col-10 href="......">{{item.phone}}</ion-col>

请帮忙

【问题讨论】:

    标签: angular ionic-framework href android-dialer


    【解决方案1】:

    不确定你想做什么。

    但是你可以像这样绑定到动态href

    <ion-col col-10 [href]="item.phone">{{item.phone}}</ion-col>
    

    <ion-col col-10 href={{item.phone}}>{{item.phone}}</ion-col>
    

    【讨论】:

    • 我想要实现的是当用户点击项目时。电话号码,用户将被重定向到电话本机拨号程序。例如 href="tel:+27800236368"
    • 好的,所以这行得通&lt;ion-col col-10&gt;&lt;a ion-item no-padding href="tel:{{item.phone}}" target="_top"&gt;{{item.phone}}&lt;/a&gt;&lt;/ion-col&gt;,需要添加一个标签并添加电话:
    猜你喜欢
    • 1970-01-01
    • 2016-04-19
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-07
    相关资源
    最近更新 更多