mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-06 23:57:30 +08:00
Added template concept
This commit is contained in:
22
js/template/Template.js
Normal file
22
js/template/Template.js
Normal file
@@ -0,0 +1,22 @@
|
||||
export default class Template {
|
||||
|
||||
/**
|
||||
* Computes the html content of the target element.
|
||||
* @param {HTMLElement} element Target element
|
||||
* @returns The computed html
|
||||
*/
|
||||
render(element) {
|
||||
return ``
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the html elements rendered by this template.
|
||||
* @param {HTMLElement} element Target element
|
||||
* @returns The rendered elements
|
||||
*/
|
||||
getElements(element) {
|
||||
let aDiv = document.createElement('div')
|
||||
aDiv.innerHTML = this.render(element)
|
||||
return aDiv.childNodes
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user