Browse Source

mod: 删除无用文件

kailong321200875 1 year ago
parent
commit
1c97d2482e
4 changed files with 37 additions and 43 deletions
  1. 34 0
      mock/role/index.ts
  2. 2 10
      src/router/index.ts
  3. 1 1
      src/views/Function/MultipleTabs.vue
  4. 0 32
      src/views/hooks/useTab.vue

+ 34 - 0
mock/role/index.ts

@@ -272,6 +272,37 @@ const adminList = [
       }
     ]
   },
+  {
+    path: '/function',
+    component: '#',
+    redirect: '/function/multipleTabs',
+    name: 'Function',
+    meta: {
+      title: 'router.function',
+      icon: 'ri:function-fill',
+      alwaysShow: true
+    },
+    children: [
+      {
+        path: 'multipleTabs',
+        component: 'views/Function/MultipleTabs',
+        name: 'MultipleTabs',
+        meta: {
+          title: 'router.multipleTabs'
+        }
+      },
+      {
+        path: 'multipleTabs-demo/:id',
+        component: 'views/Function/MultipleTabsDemo',
+        name: 'MultipleTabsDemo',
+        meta: {
+          hidden: true,
+          title: 'router.details',
+          canTo: true
+        }
+      }
+    ]
+  },
   {
     path: '/hooks',
     component: '#',
@@ -561,6 +592,9 @@ const testList: string[] = [
   '/components/infotip',
   '/Components/InputPassword',
   '/Components/Sticky',
+  'function',
+  '/function/multiple-tabs',
+  '/function/multiple-tabs-demo/:id',
   '/hooks',
   '/hooks/useWatermark',
   '/hooks/useOpenTab',

+ 2 - 10
src/router/index.ts

@@ -325,7 +325,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
     },
     children: [
       {
-        path: 'multipleTabs',
+        path: 'multiple-tabs',
         component: () => import('@/views/Function/MultipleTabs.vue'),
         name: 'MultipleTabs',
         meta: {
@@ -333,7 +333,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
         }
       },
       {
-        path: 'multipleTabs-demo/:id',
+        path: 'multiple-tabs-demo/:id',
         component: () => import('@/views/Function/MultipleTabsDemo.vue'),
         name: 'MultipleTabsDemo',
         meta: {
@@ -362,14 +362,6 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
         meta: {
           title: 'useWatermark'
         }
-      },
-      {
-        path: 'useTab',
-        component: () => import('@/views/hooks/useTab.vue'),
-        name: 'UseTab',
-        meta: {
-          title: 'useTab'
-        }
       }
       // {
       //   path: 'useCrudSchemas',

+ 1 - 1
src/views/Function/MultipleTabs.vue

@@ -6,7 +6,7 @@ import { useRouter } from 'vue-router'
 const { push } = useRouter()
 
 const openTab = (item: number) => {
-  push(`/function/multipleTabs-demo/${item}`)
+  push(`/function/multiple-tabs-demo/${item}`)
 }
 </script>
 

+ 0 - 32
src/views/hooks/useTab.vue

@@ -1,32 +0,0 @@
-<script setup lang="ts">
-import { ContentWrap } from '@/components/ContentWrap'
-import { useI18n } from '@/hooks/web/useI18n'
-import { ElButton } from 'element-plus'
-import { useWatermark } from '@/hooks/web/useWatermark'
-import { computed, onBeforeUnmount } from 'vue'
-import { useAppStore } from '@/store/modules/app'
-
-const appStore = useAppStore()
-
-const title = computed(() => appStore.getTitle)
-
-const { setWatermark, clear } = useWatermark()
-
-const { t } = useI18n()
-
-onBeforeUnmount(() => {
-  clear()
-})
-</script>
-
-<template>
-  <ContentWrap title="useTab">
-    <ElButton type="primary" @click="setWatermark(title)">
-      {{ t('watermarkDemo.createdWatermark') }}
-    </ElButton>
-    <ElButton type="danger" @click="clear">{{ t('watermarkDemo.clearWatermark') }}</ElButton>
-    <ElButton type="warning" @click="setWatermark(`New${title}`)">
-      {{ t('watermarkDemo.resetWatermark') }}
-    </ElButton>
-  </ContentWrap>
-</template>