࣮
class MyAppElement extends HTMLElement {
constructor() {
super()
const shadowRoot = this.attachShadow({ mode: 'open' })
shadowRoot.innerHTML = this.template()
}
template() {
return `
p {
color: #f00;
}
This is a custom element!
`
}
}
customElements.define('my-app', MyAppElement)
˔ ݺͼग़͢ଆλάΛࢦఆ͢Δ͚ͩ