【问题标题】:Polymer: want to open new html page on tapping of a tag or buttonPolymer:想要在点击标签或按钮时打开新的 html 页面
【发布时间】:2015-07-21 12:45:33
【问题描述】:

我使用 Polymer 开发原生移动应用,需要基本帮助。

我希望点击 Polymer 中的 <a> 标记或按钮打开新的 .html 页面

【问题讨论】:

    标签: polymer nativeapplication


    【解决方案1】:

    按钮和链接的示例:

    http://jsbin.com/rayasoquca/edit?html,output

    链接:

    <a href="https://stackoverflow.com" target="_blank">Stackoverflow</a>
    

    按钮:

    <button on-click="openStack">Stackoverflow</paper-button>
    

    点击事件处理程序:

    openstack: function() {
      window.open('https://stackoverflow.com', '_blank');
      // or: location.href='https://stackoverflow.com';
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-09
      • 2012-02-12
      • 1970-01-01
      • 2019-04-12
      • 2015-08-30
      • 1970-01-01
      • 2016-12-19
      • 1970-01-01
      相关资源
      最近更新 更多