Polymer WebComponents和Firefox兼容性

时间:2017-08-23 09:38:36

标签: firefox polymer

我的网络组件

<dom-module id="my-component">
    <template>
        <h2>YES, IT IS!</h2>
    </template>

    <script>
        Polymer({
            is: 'my-component',
        });
    </script>
</dom-module>

我的HTML页面是:

<!DOCTYPE html>
<html>
    <head>
        <script src="webjars/webcomponentsjs/0.7.22/webcomponents.js"></script>
        <link rel="import" href="webjars/polymer-elements-all/0.1.0/polymer/polymer.html">
        <link rel="import" href="my-component.html">    
    </head>

    <body>
        <h1>Is this web component shown?</h1>
        <my-component></my-component>
    </body>
</html>

我正在导入Polyfills和Polymer,对于谷歌浏览器,Microsoft Edge,即使对于Internet Explorer也是如此,但对于Firefox来说不行。在Firefox中,我的组件没有附加。

我还启用了这两个首选项https://developer.mozilla.org/en-US/docs/Web/Web_Components

请帮助:)

1 个答案:

答案 0 :(得分:0)

您可以尝试从&#34; HTML页面&#34;移动以下行吗?到您的&#34;网络组件&#34;? (确保网址正确。)

<link rel="import" href="webjars/polymer-elements-all/0.1.0/polymer/polymer.html">