mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +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";
|
||||
|
||||
export class StaticView {
|
||||
constructor(render) {
|
||||
this._root = render(tag);
|
||||
constructor(value, render = undefined) {
|
||||
if (typeof value === "function" && !render) {
|
||||
render = value;
|
||||
value = null;
|
||||
}
|
||||
this._root = render ? render(tag, value) : this.render(tag, value);
|
||||
}
|
||||
|
||||
mount() {
|
||||
|
Loading…
Reference in New Issue
Block a user