Created
February 15, 2025 17:47
-
-
Save schalkneethling/6c6d7306c2fc377380b1d9acb8170ef6 to your computer and use it in GitHub Desktop.
Web Component Patterns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class NoteCard extends HTMLElement { | |
static #selectors = { | |
template: "#notecard", | |
title: ".notecard__title", | |
content: ".notecard__content", | |
}; | |
#elements = { | |
template: this.querySelector(NoteCard.#selectors.template), | |
}; | |
#data = { | |
type: this.getAttribute("type"), | |
}; | |
constructor() { | |
super(); | |
} | |
} | |
customElements.define("note-card", NoteCard); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment