Lit SSR DOM 模擬

此套件是 Lit Labs 實驗性套件家族的一部分。請參閱Lit Labs頁面,以取得在生產環境中使用 Labs 軟體的指引。

在 Node 中執行時,Lit 會自動匯入並使用一組 DOM 填充碼,並定義 customElements 全域變數。只會實作定義和註冊元件所需的最少 DOM 介面。這包括一些關鍵的 DOM 類別和大致運作的 CustomElementRegistry

✅ 表示項目實作的功能與瀏覽器中相同。

屬性註解
Element⚠️ 部分實作
attributes
shadowRoot⚠️ 如果使用 {mode: 'open'} 呼叫 attachShadow(),則返回 {host: this}
setAttribute()
removeAttribute()
hasAttribute()
attachShadow()⚠️ 返回 {host: this}
getAttribute()
HTMLElement⚠️ 空類別
CustomElementRegistry
define()
get()
customElementsCustomElementRegistry 的實例