Files
LingChair/client/ui/chat-elements/chat-text-container.ts
2025-12-06 00:18:10 +08:00

17 lines
489 B
TypeScript

customElements.define('chat-text-container', class extends HTMLElement {
declare container: HTMLDivElement
constructor() {
super()
this.attachShadow({ mode: 'open' })
}
connectedCallback() {
const shadow = this.shadowRoot as ShadowRoot
this.container = document.createElement('div')
this.container.style.padding = '13px'
shadow.appendChild(this.container)
this.container.innerHTML = this.innerHTML
}
})