修复路由不存在时的报错
parent
a1c1740166
commit
37dcc51e05
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "wkitd",
|
"name": "wkitd",
|
||||||
"version": "1.3.7",
|
"version": "1.3.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|
|
@ -156,7 +156,7 @@ class Router {
|
||||||
$view.current = route.name
|
$view.current = route.name
|
||||||
this.#route = route
|
this.#route = route
|
||||||
|
|
||||||
if (typeof table.component === 'function') {
|
if (table && typeof table.component === 'function') {
|
||||||
if (!customElements.get(route.name)) {
|
if (!customElements.get(route.name)) {
|
||||||
table.component()
|
table.component()
|
||||||
delete table.component //避免多次请求
|
delete table.component //避免多次请求
|
||||||
|
|
Loading…
Reference in New Issue