json { "entrypoint": "index.html", "shell": "src/my-app/my-app.html", "fragments": [ "src/my-component/my-component.html" ], "builds": [{ "preset": "es6-bundled", "name": "my-app", "html": { "minify": true }, "js": { "minify": true }, "css": { "minify": true } }] } html <link rel="import" href="../../@polymer/polymer/polymer-element.html"> <dom-module id="my-component"> <template> <style> :host { display: block; padding: 16px; background-color: #f5f5f5; border-radius: 4px; } </style> <div>Hello, <span>{{name}}</span>!</div> </template> <script> class MyComponent extends Polymer.Element { static get is() { return 'my-component'; } static get properties() { return { name: { type: String, value: 'Polymer' } }; } } window.customElements.define(MyComponent.is, MyComponent); </script> </dom-module>


上一篇:
下一篇:
切换中文