Add option for customized built-in elements
This commit is contained in:
parent
60af0773a0
commit
137f586400
1 changed files with 4 additions and 1 deletions
|
@ -46,7 +46,10 @@ export class BetterHTMLElement extends HTMLElement {
|
|||
})
|
||||
})
|
||||
name = name.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()
|
||||
customElements.define(name, this)
|
||||
if (this.extends)
|
||||
customElements.define(name, this, { extends: this.extends })
|
||||
else
|
||||
customElements.define(name, this)
|
||||
return name
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue