mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(html): add element registrations
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export function defineCustomElement(tagName: string, ctor: CustomElementConstructor): void {
|
||||
if (typeof window === 'undefined') return;
|
||||
|
||||
if (window.customElements.get(tagName)) return;
|
||||
|
||||
window.customElements.define(tagName, ctor);
|
||||
}
|
||||
Reference in New Issue
Block a user