diff --git a/src/router/index.ts b/src/router/index.ts index c1bf461..1a9e416 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 ==> 路由路径 @@ -109,6 +110,7 @@ export const asyncRoutes = [ dataScreenRouter, chartsRouter, tableRouter, + formRouter, chatRouter, othersRouter, nestedRouter, @@ -118,10 +120,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 279ec3a..efed6dc 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 @@ + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 立即创建 + 重置 + + + + + + +