Browse Source

feat: adds dynamic router page

nian 2 months ago
parent
commit
699ab72499
3 changed files with 3 additions and 3 deletions
  1. 1 1
      src/layout/main/index.vue
  2. 1 1
      src/router/record.ts
  3. 1 1
      src/typings/vue-router.d.ts

+ 1 - 1
src/layout/main/index.vue

@@ -40,7 +40,7 @@ function createTab(route: RouteLocationNormalizedLoaded) {
     componentName,
     icon = 'iconify ph--browser',
     label: defaultLabel = '未命名标签',
-    tabLabel,
+    renderTabLabel: tabLabel,
   } = route.meta
 
   const { fullPath, name, params } = route

+ 1 - 1
src/router/record.ts

@@ -174,7 +174,7 @@ export const routeRecordRaw: MergeMenuMixedOptions[] = [
       componentName: 'DynamicRoute',
       showTab: true,
       enableMultiTab: true,
-      tabLabel({ id, name }) {
+      renderTabLabel({ id, name }) {
         return `动态路由${id ? `-${id}` : ''}${name ? `-${name}` : ''}`
       },
     },

+ 1 - 1
src/typings/vue-router.d.ts

@@ -8,6 +8,6 @@ declare module 'vue-router' {
     icon?: string
     showTab?: boolean
     enableMultiTab?: boolean
-    tabLabel?: (params: RouteParamsGeneric) => string
+    renderTabLabel?: (params: RouteParamsGeneric) => string
   }
 }