首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >聚合物无光DOMException

聚合物无光DOMException
EN

Stack Overflow用户
提问于 2018-04-20 12:43:29
回答 1查看 424关注 0票数 3

我有一个简单的aap在聚合物2。它的工作完美,但当我添加元素从聚合物目录,然后我得到以下错误?还有纸输入没有正确显示?看看截图。一切都很完美我不知道为什么会突然发生这种事?

dom-module.html:136 Uncaught :未能在“CustomElementRegistry”上执行“定义”:此名称已与在 http://127.0.0.1:8000/components/polymer-todo/bower at http://127.0.0.1:8000/components/polymer-todo/bower的注册表一起使用

我的代码很简单

代码语言:javascript
复制
<link rel="import" href="../polymer/polymer-element.html">
<link rel="import" href="../polymer/lib/elements/dom-repeat.html">

<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html">
<link rel="import" href="bower_components/paper-input/paper-input.html">



<dom-module id="polymer-todo">
  <template>
   <h3>Todo:</h3>
   <dom-repeat
      items="{{tasks}}"
      as="task">
      <template>
        <div>

          <paper-checkbox ></paper-checkbox>


          <paper-input value="{{task}}"></paper-input>

        </div>
      </template>
   </dom-repeat>





    <button>Add task</button>
  </template>

  <script>
    /**
     * `polymer-todo`
     * Simple to do to add Todos
     *
     * @customElement
     * @polymer
     * @demo demo/index.html
     */
    class PolymerTodo extends Polymer.Element {
      static get is() { return 'polymer-todo'; }
      static get properties() {
        return {
          tasks: {
            type: Array,
            value: () => [1, 2, 3, 4, 5]
            }
        };
      }
    }

    window.customElements.define(PolymerTodo.is, PolymerTodo);
  </script>
</dom-module>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-04 21:15:18

我修好了。其实我变了

<link rel="import" href="bower_components/paper-checkbox/paper-checkbox.html">

等到

<link rel="import" href="../paper-checkbox/paper-checkbox.html">

而且起作用了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49941933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档