diff --git a/src/router/index.js b/src/router/index.js index 1072cf6..fb3ed5c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -34,6 +34,13 @@ const routes = [ component: change_user, } ] + }, + { + // 如果你省略了最后一个' * ',参数中的' / '字符将在解析或推入时被编码 + // 最后一个*,它意味着重复的参数,如果您打算使用它的名称直接导航到未找到的路由,那么这是必要的 + path:"/:pathMatch(.*)*", + name:'notfound', + component: ()=>import('../views/Error/PageNotFound.vue') } ] diff --git a/src/views/Error/PageNotFound.vue b/src/views/Error/PageNotFound.vue new file mode 100644 index 0000000..40b3105 --- /dev/null +++ b/src/views/Error/PageNotFound.vue @@ -0,0 +1,13 @@ + + + + +