From 97967ff27a612945274e12b280accf8fb8f3d0ac Mon Sep 17 00:00:00 2001 From: RogerWork Date: Wed, 20 Sep 2023 09:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E7=9A=84=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E4=BB=A5=E5=8F=8A=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?404=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 7 +++++++ src/views/Error/PageNotFound.vue | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/views/Error/PageNotFound.vue 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 @@ + + + + +