mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:28:17 +08:00
25 lines
629 B
JavaScript
25 lines
629 B
JavaScript
/**
|
|
* @typedef {import("../graph/GraphNode").default} GraphNode
|
|
*/
|
|
export default class Template {
|
|
|
|
/**
|
|
* Computes the html content of the target element.
|
|
* @param {GraphNode} element Target element
|
|
* @returns The computed html
|
|
*/
|
|
render(element) {
|
|
return ``
|
|
}
|
|
|
|
/**
|
|
* Returns the html elements rendered by this template.
|
|
* @param {GraphNode} element Target element
|
|
* @returns The rendered elements
|
|
*/
|
|
getElements(element) {
|
|
let aDiv = document.createElement('div')
|
|
aDiv.innerHTML = this.render(element)
|
|
return aDiv.childNodes
|
|
}
|
|
} |