mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 14:18:08 +00:00
use custom elements for application layout
This commit is contained in:
@@ -68,6 +68,10 @@ class RouterService {
|
||||
const _newElement = document.createElement(
|
||||
route.layout
|
||||
);
|
||||
_newElement.setAttribute(
|
||||
"data-target",
|
||||
"app-root.rootElement"
|
||||
);
|
||||
_mainRoot.replaceChild(_newElement, child);
|
||||
(_newElement as BaseLayoutElement).setElement(
|
||||
route.component
|
||||
@@ -79,6 +83,10 @@ class RouterService {
|
||||
const _newElement = document.createElement(
|
||||
route.component
|
||||
);
|
||||
_newElement.setAttribute(
|
||||
"data-target",
|
||||
"app-root.rootElement"
|
||||
);
|
||||
changed = true;
|
||||
_mainRoot.replaceChild(_newElement, child);
|
||||
}
|
||||
@@ -87,12 +95,20 @@ class RouterService {
|
||||
if (route.layout) {
|
||||
changed = true;
|
||||
const _newElement = document.createElement(route.layout);
|
||||
_newElement.setAttribute(
|
||||
"data-target",
|
||||
"app-root.rootElement"
|
||||
);
|
||||
_mainRoot.appendChild(_newElement);
|
||||
(_newElement as BaseLayoutElement).setElement(
|
||||
route.component
|
||||
);
|
||||
} else {
|
||||
const _newElement = document.createElement(route.component);
|
||||
_newElement.setAttribute(
|
||||
"data-target",
|
||||
"app-root.rootElement"
|
||||
);
|
||||
changed = true;
|
||||
_mainRoot.appendChild(_newElement);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user