【问题标题】:Polymer not working on Firefox聚合物不适用于 Firefox
【发布时间】:2015-02-20 07:12:23
【问题描述】:

我在我的一个网络项目中使用了 Polymer。在 index.html 页面中,我通过以下方式包含了脚本和包含标签:

<link rel="import" href="bower_components/core-item/core-item.html">
<link rel="import" href="bower_components/paper-button/paper-button.html">
<script src="scripts/jquery.min.js"></script>
<link href="styles/css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="styles/mycss.css">

body 标记中,我使用paper-button 的方式如下:

<paper-button class="blue-ripple" role="button" tabindex="0">Hello</paper-button>

它在 Chrome (40.0.2214.111 m) 上完美呈现,但波纹样式在 Firefox (35.0.1) 上不起作用。我检查了控制台,似乎没有冲突、警告或错误。

【问题讨论】:

  • 你解决过这个问题吗?

标签: google-chrome firefox polymer


【解决方案1】:

你需要加载 polyfill:

<script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>

https://www.polymer-project.org/docs/start/platform.html

【讨论】:

  • 感谢您的回复。我尝试添加 webcomponents.min.js 但它导致浏览器中抛出许多控制台异常。
  • 具体来说,我在prototype.js 的第 824 行收到此错误TypeError: this.each is not a function 该行周围的功能块转到function o(e, t) { var n = []; this.each(function(r, i) { // line 824 if (e.call(t, r, i)) n.push(r) }); return n }
【解决方案2】:

在第三个link 标记您的href 指向styles/css
这可能是问题所在。

【讨论】:

  • 呈现网站的一些样式。不过,取消注释对结果没有任何影响。
猜你喜欢
  • 1970-01-01
  • 2016-06-10
  • 1970-01-01
  • 1970-01-01
  • 2021-03-26
  • 2018-01-24
  • 1970-01-01
  • 2014-07-06
  • 2016-11-15
相关资源
最近更新 更多