私はポリマーを初めて使用しており、<paper-button>
をマイページに掲載しようとしています。このプロジェクトはPolymer Starter Kitに基づいています。 <paper-button>
要素を使用しようとすると、コンソールに名前が既に登録されているというエラーが表示されます。なぜそれがこれを言うのかわからない。私はpaper-button.html
参照を1回だけ使用します。エラーがある:https://github.com/Renniesb/paper-test:ポリマー要素がすでに用紙ボタンのエラーに登録されています
Uncaught NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'dom-module'. A type with that name is already registered.
次ここ
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="/src/bower_components/paper-button/paper-button.html">
<link rel="import" href="shared-styles.html">
<dom-module id="my-view1">
<template>
<style include="shared-styles">
:host {
display: block;
padding: 10px;
}
h1 {
text-align: center;
}
</style>
<div class="card">
<!-- <div class="circle">1</div> -->
<h1>Gas vs. Electric Car Calculator</h1>
<paper-button>$20,000</paper-button>
</div>
</template>
<script>
Polymer({
is: 'my-view1',
});
</script>
</dom-module>
そのエラーを生成するコードであることも、コード付きのGitHubリポジトリへのリンクです。コードをテストするには、ダウンロードして実行してください:npm install
とbower install
。存在しないパスへ