mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:17:41 +08:00
24 lines
604 B
JavaScript
Executable File
24 lines
604 B
JavaScript
Executable File
/**
|
|
* @typedef {import("../element/IElement").default} IElement
|
|
*/
|
|
export default class Template {
|
|
|
|
/**
|
|
* Computes the html content of the target element.
|
|
* @param {IElement} entity Element of the graph
|
|
* @returns The result html
|
|
*/
|
|
render(entity) {
|
|
return ""
|
|
}
|
|
|
|
/**
|
|
* Applies the style to the element.
|
|
* @param {IElement} element Element of the graph
|
|
*/
|
|
apply(element) {
|
|
// TODO replace with the safer element.setHTML(...) when it will be available
|
|
element.innerHTML = this.render(element)
|
|
}
|
|
}
|