Skip to content

Commit

Permalink
slotを使用
Browse files Browse the repository at this point in the history
  • Loading branch information
IttetsuSato committed Nov 4, 2024
1 parent 41d5661 commit 8e7fd14
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/definitionList/sp-definition-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ styles.replaceSync(`${resetStyle} ${foundationStyle} ${spDefinitionListStyle}`);

export class SpDefinitionList extends HTMLElement {
#dlElement = document.createElement("dl");
#slotElement = document.createElement("slot");

constructor() {
super();
Expand All @@ -22,9 +23,7 @@ export class SpDefinitionList extends HTMLElement {
styles,
];
this.#dlElement.classList.add("base");
while (this.firstChild) {
this.#dlElement.appendChild(this.firstChild);
}
this.#dlElement.appendChild(this.#slotElement);
this.shadowRoot.appendChild(this.#dlElement);
}
}
Expand Down

0 comments on commit 8e7fd14

Please sign in to comment.