【发布时间】:2017-08-23 09:38:35
【问题描述】:
我的网络组件是
<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,它适用于 Google Chrome、Microsoft Edge,甚至适用于 Internet Explorer,但不适用于 Firefox。在 Firefox 中,我的组件没有附加。
我还启用了这两个首选项https://developer.mozilla.org/en-US/docs/Web/Web_Components。
请帮忙:)
【问题讨论】:
-
除了Polyfills webjar,我也试过
webcomponentsjs-0.7.22CDN库:cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.22/…