暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

card-contents.html 980B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template id="card-contents">
  2. <style>
  3. :host {
  4. padding: 6px;
  5. border-radius: 6px;
  6. background-color: white;
  7. border-color: inherit;
  8. display: flex;
  9. flex-direction: column;
  10. flex: 1;
  11. font-size: inherit;
  12. }
  13. </style>
  14. <content></content>
  15. </template>
  16. <script>
  17. (function (window, document) {
  18. var elemName = 'card-contents';
  19. var mainDoc = document;
  20. var importDoc = document.currentScript.ownerDocument;
  21. var proto = Object.create(HTMLElement.prototype);
  22. proto.createdCallback = function () {
  23. var template = importDoc.getElementById(elemName);
  24. var clone = mainDoc.importNode(template.content, true);
  25. var root = this.createShadowRoot();
  26. root.appendChild(clone);
  27. }
  28. mainDoc.registerElement(elemName, { prototype: proto });
  29. })(window, document);
  30. </script>