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

card-contents.html 1.0KB

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