parent
b7567a15fc
commit
a1c1740166
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "wkitd",
|
"name": "wkitd",
|
||||||
"version": "1.3.6",
|
"version": "1.3.7",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -152,8 +152,16 @@ class Router {
|
||||||
|
|
||||||
#exec(route) {
|
#exec(route) {
|
||||||
let $view = window.wkitd.get(__ROUTER_VIEW__)
|
let $view = window.wkitd.get(__ROUTER_VIEW__)
|
||||||
|
let table = this.#tables.get(route.path)
|
||||||
$view.current = route.name
|
$view.current = route.name
|
||||||
this.#route = route
|
this.#route = route
|
||||||
|
|
||||||
|
if (typeof table.component === 'function') {
|
||||||
|
if (!customElements.get(route.name)) {
|
||||||
|
table.component()
|
||||||
|
delete table.component //避免多次请求
|
||||||
|
}
|
||||||
|
}
|
||||||
this.#broadcast()
|
this.#broadcast()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue