mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-22 14:17:30 +08:00
Added cleanup concept to the template
This commit is contained in:
@@ -13,8 +13,6 @@
|
||||
*/
|
||||
export default class IElement extends HTMLElement {
|
||||
|
||||
static tagName = ""
|
||||
|
||||
/** @type {Blueprint} */
|
||||
#blueprint
|
||||
get blueprint() {
|
||||
@@ -62,15 +60,18 @@ export default class IElement extends HTMLElement {
|
||||
|
||||
connectedCallback() {
|
||||
this.#blueprint = this.closest("ueb-blueprint")
|
||||
this.template.apply(this)
|
||||
this.template.setup(this)
|
||||
this.inputObjects = this.createInputObjects()
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
this.inputObjects.forEach(v => v.unlistenDOMElement())
|
||||
this.template.cleanup(this)
|
||||
}
|
||||
|
||||
/** @param {IElement} element */
|
||||
/**
|
||||
* @param {IElement} element
|
||||
*/
|
||||
isSameGraph(element) {
|
||||
return this.#blueprint && this.#blueprint == element?.blueprint
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user