修复路由不存在时的报错

master
yutent 2024-05-09 16:47:26 +08:00
parent a1c1740166
commit 37dcc51e05
2 changed files with 2 additions and 2 deletions

View File

@ -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": [

View File

@ -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 //避免多次请求