mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
support render method and value in StaticView
This commit is contained in:
parent
41d624a1ae
commit
efe6956a79
@ -18,8 +18,12 @@ limitations under the License.
|
|||||||
import {tag} from "../general/html.js";
|
import {tag} from "../general/html.js";
|
||||||
|
|
||||||
export class StaticView {
|
export class StaticView {
|
||||||
constructor(render) {
|
constructor(value, render = undefined) {
|
||||||
this._root = render(tag);
|
if (typeof value === "function" && !render) {
|
||||||
|
render = value;
|
||||||
|
value = null;
|
||||||
|
}
|
||||||
|
this._root = render ? render(tag, value) : this.render(tag, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
mount() {
|
mount() {
|
||||||
|
Loading…
Reference in New Issue
Block a user