script
タグを使って完全に作成することもできますが、これはこのトピックの一部ではありません。 style
タグは最低限の構造の一部ではありませんが、理解のためにそこに保持されています。 js
ファイルを持ち、それを要素で参照することができます。 id
のdom-module
してis
の財産Polymer constructor
常に同じである必要があります。 バージョン | 発売日 |
---|---|
v1.6.0 | 2016年6月29日 |
v1.5.0 | 2016-05-31 |
v1.4.0 | 2016年5月18日 |
v1.0.0 | 2015-05-27 |
内容のない要素を定義する。
<dom-module id="empty-element">
<template>
<style>
</style>
</template>
<script>
Polymer({
is: 'empty-element',
});
</script>
</dom-module>
そして、あなたは他のどのページでも新しい要素を使うことができます。
<!DOCTYPE html>
<html>
<head>
<!-- Using lite version as Polymer does not require Polyfill for Shadow Dom -->
<script src="path/to/bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<!-- Importing the element assuming file name is also empty-element.html -->
<link rel="import" href="empty-element.html">
</head>
<body>
<empty-element></empty-element>
</body>
</html>