Browse Source

fix: 修复重定向错误

kailong321200875 2 years ago
parent
commit
89d03fd067
3 changed files with 7 additions and 2 deletions
  1. 3 1
      mock/role/index.ts
  2. 3 1
      src/router/index.ts
  3. 1 0
      src/views/Example/Dialog/ExampleDialog.vue

+ 3 - 1
mock/role/index.ts

@@ -73,7 +73,7 @@ const adminList = [
   {
     path: '/components',
     component: '#',
-    redirect: '/components/icon',
+    redirect: '/components/form/default-form',
     name: 'ComponentsDemo',
     meta: {
       title: 'router.component',
@@ -119,6 +119,7 @@ const adminList = [
       {
         path: 'table',
         component: '##',
+        redirect: '/components/table/default-table',
         name: 'TableDemo',
         meta: {
           title: 'router.table',
@@ -154,6 +155,7 @@ const adminList = [
       {
         path: 'editor-demo',
         component: '##',
+        redirect: '/components/editor-demo/editor',
         name: 'EditorDemo',
         meta: {
           title: 'router.editor',

+ 3 - 1
src/router/index.ts

@@ -124,7 +124,6 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
   {
     path: '/components',
     component: Layout,
-    redirect: '/components/icon',
     name: 'ComponentsDemo',
     meta: {
       title: t('router.component'),
@@ -135,6 +134,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
       {
         path: 'form',
         component: getParentLayout(),
+        redirect: '/components/form/default-form',
         name: 'Form',
         meta: {
           title: t('router.form'),
@@ -170,6 +170,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
       {
         path: 'table',
         component: getParentLayout(),
+        redirect: '/components/table/default-table',
         name: 'TableDemo',
         meta: {
           title: t('router.table'),
@@ -205,6 +206,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
       {
         path: 'editor-demo',
         component: getParentLayout(),
+        redirect: '/components/editor-demo/editor',
         name: 'EditorDemo',
         meta: {
           title: t('router.editor'),

+ 1 - 0
src/views/Example/Dialog/ExampleDialog.vue

@@ -157,6 +157,7 @@ const AddAction = () => {
   dialogTitle.value = t('exampleDemo.add')
   tableObject.currentRow = null
   dialogVisible.value = true
+  actionType.value = ''
 }
 
 const delLoading = ref(false)