2
0
mirror of https://github.com/esiur/iui.git synced 2026-04-04 06:58:22 +00:00
This commit is contained in:
2021-11-06 14:53:52 +03:00
parent 1bac10e60d
commit 589c4f3227
31 changed files with 12721 additions and 315 deletions

View File

@@ -1,6 +1,7 @@
import IUIElement from "../Core/IUIElement.js";
import { IUI } from "../Core/IUI.js";
import Router from "./Router.js";
import RefsCollection from "../Core/RefsCollection.js";
export default IUI.module(class Route extends IUIElement {
@@ -8,7 +9,7 @@ export default IUI.module(class Route extends IUIElement {
super();
this.routes = [];
this.refs = {};
this.refs = new RefsCollection(this);
this._register("show");
this._register("hide");
@@ -21,6 +22,10 @@ export default IUI.module(class Route extends IUIElement {
return await super.setData(value);
}
get scope(){
return {route: this, view: this};
}
_updateLinks() {
for (var i = 0; i < this.children.length; i++) {
if (this.children[i] instanceof Route) {
@@ -111,9 +116,9 @@ export default IUI.module(class Route extends IUIElement {
if (window?.app?.loaded)
{
await IUI.create(this);
IUI.bind(this, true, "route:" + src, this.scope);
this.refs._build();
await IUI.created(this);
IUI.bind(this, this, "route:" + src);
await IUI.render(this, this._data, true);
}
@@ -152,7 +157,7 @@ export default IUI.module(class Route extends IUIElement {
created()
{
this.refs._build();
}
set(value) {