mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-28 03:24:43 +08:00
Refactoring
This commit is contained in:
18
js/graph/GraphElement.js
Executable file
18
js/graph/GraphElement.js
Executable file
@@ -0,0 +1,18 @@
|
||||
export default class GraphElement extends HTMLElement {
|
||||
/**
|
||||
*
|
||||
* @param {import("../template/Template").default} template The template to render this node
|
||||
*/
|
||||
constructor(entity, template) {
|
||||
super()
|
||||
/** @type {import("../Blueprint").default}" */
|
||||
this.blueprint = null
|
||||
this.entity = entity
|
||||
this.template = template
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
this.blueprint = this.closest('u-blueprint')
|
||||
this.append(...this.template.getElements(this.entity))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user