From 70b640af4f166cddf6550dc81a61049c6c21da8e Mon Sep 17 00:00:00 2001 From: zouzhibing Date: Wed, 14 Sep 2022 08:46:24 +0800 Subject: [PATCH] =?UTF-8?q?update:=E8=A1=A8=E5=8D=95=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=8F=90=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 10 +- src/router/modules/from.ts | 26 +++ src/router/modules/other.ts | 6 - .../components/Upload.vue} | 0 src/views/form/validateForm.vue | 156 ++++++++++++++++++ 5 files changed, 188 insertions(+), 10 deletions(-) create mode 100644 src/router/modules/from.ts rename src/views/{other/form/u-upload.vue => form/components/Upload.vue} (100%) create mode 100644 src/views/form/validateForm.vue diff --git a/src/router/index.ts b/src/router/index.ts index 7333c74..a529ca0 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -19,6 +19,7 @@ import chatRouter from './modules/chat' import componentsRouter from './modules/components' import othersRouter from './modules/other' import externalLink from './modules/externalLink' +import formRouter from './modules/from' /** * path ==> 路由路径 @@ -107,6 +108,7 @@ export const asyncRoutes = [ dataScreenRouter, chartsRouter, tableRouter, + formRouter, chatRouter, othersRouter, nestedRouter, @@ -116,10 +118,10 @@ export const asyncRoutes = [ externalLink, clipboardTable, systemRouter, - { - path: '/:pathMatch(.*)', - redirect: '/error/404' - } + // { + // path: '/:pathMatch(.*)', + // redirect: '/error/404' + // } ] const router = createRouter({ diff --git a/src/router/modules/from.ts b/src/router/modules/from.ts new file mode 100644 index 0000000..42e7ca2 --- /dev/null +++ b/src/router/modules/from.ts @@ -0,0 +1,26 @@ + +/** When your routing table is too long, you can split it into small modules**/ + +import Layout from "@/layout/index.vue"; + +const formRouter = { + path: '/form', + component: Layout, + redirect: 'noRedirect', + name: 'form', + alwaysShow:true, + meta: { + title: '超级表单', + icon: 'Grape' + }, + children: [ + { + path: 'validateForm', + component: () => import('@/views/form/validateForm.vue'), + name: 'validate-form', + meta: { title: '校验 Form', keepAlive: true , icon: 'MenuIcon'} + }, + ] +} + +export default formRouter diff --git a/src/router/modules/other.ts b/src/router/modules/other.ts index 657f205..5074b4f 100644 --- a/src/router/modules/other.ts +++ b/src/router/modules/other.ts @@ -42,12 +42,6 @@ const othersRouter = { name: 'grid-sorter', meta: { title: '卡片拖拽', icon: 'MenuIcon' } }, - { - path: 'form', - component: () => import('@/views/other/form.vue'), - name: 'form', - meta: { title: '表单', roles:['other'], icon: 'MenuIcon'} - }, { path: 'upload', component: () => import('@/views/other/upload.vue'), diff --git a/src/views/other/form/u-upload.vue b/src/views/form/components/Upload.vue similarity index 100% rename from src/views/other/form/u-upload.vue rename to src/views/form/components/Upload.vue diff --git a/src/views/form/validateForm.vue b/src/views/form/validateForm.vue new file mode 100644 index 0000000..39c1bb1 --- /dev/null +++ b/src/views/form/validateForm.vue @@ -0,0 +1,156 @@ + + + +