【问题标题】:Why href inside button not working?为什么按钮内的href不起作用?
【发布时间】:2015-05-27 13:46:54
【问题描述】:
<button class="button button-outline button-positive">
    <a href="www.google.com">fes</a>
</button>

如果我使用ng-click,它可以正常工作,但我需要href

【问题讨论】:

    标签: ionic-framework href


    【解决方案1】:

    放下按钮并用类名装饰a 元素。

    <a href="www.google.com" class="button button-outline button-positive">fes</a>
    

    希望这会有所帮助。

    【讨论】:

    • 我不了解 OP,但它确实帮助了我。我有同样的问题,无法弄清楚出了什么问题。谢谢!
    【解决方案2】:

    在html页面中:

    <button menuClose ion-item (click)="openExternalPage(urlCgu)"><ion-icon name="ios-paper-outline" color="primary" item-start ></ion-icon> Conditions d'utilisation</button>
    

    在ts页面中:

    urlCgu:string;
    this.urlCgu = 'http://xxxxxxx.com';
    
    openExternalPage(page){
        window.open(page);
    }
    

    【讨论】:

    • 可能想在答案中添加一些变化/差异,而不仅仅是发布代码。
    猜你喜欢
    • 2015-03-11
    • 1970-01-01
    • 2016-03-20
    • 2016-07-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-19
    • 2012-09-03
    相关资源
    最近更新 更多