作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在构建一个网站,我会在其中使用不同的 polymer 组件,其中一些组件会多次使用。
我的问题是编译后的代码包含
customElements.define('dom-module', DomModule);
抛出
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': this name has already been used with this registry at CustomElementRegistry.value
我不知道如何解决这个问题。
最佳答案
如果您在两个不同的组件中使用两个不同的路径包含 polymer ,则它们都会被执行,并且都尝试定义 dom-module、dom-if 等。
因此请检查网络面板是否有相同的文件名但不同的路径。
示例:
/bower_components/webcomponentsjs/webcomponents-loader.js
and
/components/webcomponentsjs/webcomponents-loader.js
关于Polymer DomModule 已定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46731888/
我正在构建一个网站,我会在其中使用不同的 polymer 组件,其中一些组件会多次使用。 我的问题是编译后的代码包含 customElements.define('dom-module', DomM
我是一名优秀的程序员,十分优秀!