暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

card-contents.html 1008B

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