Browse Source

fix: change showMainRoute to canTo

kailong321200875 2 years ago
parent
commit
5e292f8a2b

+ 14 - 14
package.json

@@ -27,7 +27,7 @@
   },
   },
   "dependencies": {
   "dependencies": {
     "@iconify/iconify": "^2.2.1",
     "@iconify/iconify": "^2.2.1",
-    "@vueuse/core": "^8.7.4",
+    "@vueuse/core": "^8.7.5",
     "@wangeditor/editor": "^5.1.1",
     "@wangeditor/editor": "^5.1.1",
     "@wangeditor/editor-for-vue": "^5.1.10",
     "@wangeditor/editor-for-vue": "^5.1.10",
     "@zxcvbn-ts/core": "^2.0.1",
     "@zxcvbn-ts/core": "^2.0.1",
@@ -45,7 +45,7 @@
     "pinia": "^2.0.14",
     "pinia": "^2.0.14",
     "pinia-plugin-persist": "^1.0.0",
     "pinia-plugin-persist": "^1.0.0",
     "qrcode": "^1.5.0",
     "qrcode": "^1.5.0",
-    "qs": "^6.10.5",
+    "qs": "^6.11.0",
     "url": "^0.11.0",
     "url": "^0.11.0",
     "vue": "3.2.37",
     "vue": "3.2.37",
     "vue-i18n": "9.1.10",
     "vue-i18n": "9.1.10",
@@ -54,9 +54,9 @@
     "web-storage-cache": "^1.1.1"
     "web-storage-cache": "^1.1.1"
   },
   },
   "devDependencies": {
   "devDependencies": {
-    "@commitlint/cli": "^17.0.2",
-    "@commitlint/config-conventional": "^17.0.2",
-    "@iconify/json": "^2.1.63",
+    "@commitlint/cli": "^17.0.3",
+    "@commitlint/config-conventional": "^17.0.3",
+    "@iconify/json": "^2.1.70",
     "@intlify/vite-plugin-vue-i18n": "^3.4.0",
     "@intlify/vite-plugin-vue-i18n": "^3.4.0",
     "@purge-icons/generated": "^0.8.1",
     "@purge-icons/generated": "^0.8.1",
     "@types/intro.js": "^3.0.2",
     "@types/intro.js": "^3.0.2",
@@ -66,26 +66,26 @@
     "@types/nprogress": "^0.2.0",
     "@types/nprogress": "^0.2.0",
     "@types/qrcode": "^1.4.2",
     "@types/qrcode": "^1.4.2",
     "@types/qs": "^6.9.7",
     "@types/qs": "^6.9.7",
-    "@typescript-eslint/eslint-plugin": "^5.28.0",
-    "@typescript-eslint/parser": "^5.28.0",
+    "@typescript-eslint/eslint-plugin": "^5.30.0",
+    "@typescript-eslint/parser": "^5.30.0",
     "@vitejs/plugin-vue": "^2.3.3",
     "@vitejs/plugin-vue": "^2.3.3",
     "@vitejs/plugin-vue-jsx": "^1.3.10",
     "@vitejs/plugin-vue-jsx": "^1.3.10",
     "autoprefixer": "^10.4.7",
     "autoprefixer": "^10.4.7",
     "eslint": "^8.18.0",
     "eslint": "^8.18.0",
     "eslint-config-prettier": "^8.5.0",
     "eslint-config-prettier": "^8.5.0",
     "eslint-define-config": "^1.5.1",
     "eslint-define-config": "^1.5.1",
-    "eslint-plugin-prettier": "^4.0.0",
+    "eslint-plugin-prettier": "^4.2.1",
     "eslint-plugin-vue": "^9.1.1",
     "eslint-plugin-vue": "^9.1.1",
     "husky": "^8.0.1",
     "husky": "^8.0.1",
     "less": "^4.1.3",
     "less": "^4.1.3",
-    "lint-staged": "^13.0.2",
+    "lint-staged": "^13.0.3",
     "plop": "^3.1.1",
     "plop": "^3.1.1",
     "postcss": "^8.4.14",
     "postcss": "^8.4.14",
     "postcss-html": "^1.4.1",
     "postcss-html": "^1.4.1",
     "postcss-less": "^6.0.0",
     "postcss-less": "^6.0.0",
     "prettier": "^2.7.1",
     "prettier": "^2.7.1",
     "rimraf": "^3.0.2",
     "rimraf": "^3.0.2",
-    "rollup": "^2.75.6",
+    "rollup": "^2.75.7",
     "stylelint": "^14.9.1",
     "stylelint": "^14.9.1",
     "stylelint-config-html": "^1.0.0",
     "stylelint-config-html": "^1.0.0",
     "stylelint-config-prettier": "^9.0.3",
     "stylelint-config-prettier": "^9.0.3",
@@ -94,16 +94,16 @@
     "stylelint-order": "^5.0.0",
     "stylelint-order": "^5.0.0",
     "typescript": "4.7.4",
     "typescript": "4.7.4",
     "unplugin-vue-define-options": "^0.6.1",
     "unplugin-vue-define-options": "^0.6.1",
-    "vite": "2.9.12",
+    "vite": "2.9.13",
     "vite-plugin-eslint": "^1.6.1",
     "vite-plugin-eslint": "^1.6.1",
     "vite-plugin-html": "^3.2.0",
     "vite-plugin-html": "^3.2.0",
     "vite-plugin-mock": "^2.9.6",
     "vite-plugin-mock": "^2.9.6",
     "vite-plugin-purge-icons": "^0.8.1",
     "vite-plugin-purge-icons": "^0.8.1",
     "vite-plugin-style-import": "^1.4.1",
     "vite-plugin-style-import": "^1.4.1",
     "vite-plugin-svg-icons": "^2.0.1",
     "vite-plugin-svg-icons": "^2.0.1",
-    "vite-plugin-windicss": "^1.8.4",
-    "vue-tsc": "^0.38.1",
-    "windicss": "^3.5.4",
+    "vite-plugin-windicss": "^1.8.6",
+    "vue-tsc": "^0.38.2",
+    "windicss": "^3.5.6",
     "windicss-analysis": "^0.3.5"
     "windicss-analysis": "^0.3.5"
   },
   },
   "engines": {
   "engines": {

+ 1 - 1
src/components/Breadcrumb/src/helper.ts

@@ -9,7 +9,7 @@ export const filterBreadcrumb = (
 
 
   for (const route of routes) {
   for (const route of routes) {
     const meta = route?.meta as RouteMeta
     const meta = route?.meta as RouteMeta
-    if (meta.hidden && !meta.showMainRoute) {
+    if (meta.hidden && !meta.canTo) {
       continue
       continue
     }
     }
 
 

+ 1 - 1
src/components/TabMenu/src/helper.ts

@@ -27,7 +27,7 @@ export const filterMenusPath = (
   for (const v of routes) {
   for (const v of routes) {
     let data: Nullable<AppRouteRecordRaw> = null
     let data: Nullable<AppRouteRecordRaw> = null
     const meta = (v.meta ?? {}) as RouteMeta
     const meta = (v.meta ?? {}) as RouteMeta
-    if (!meta.hidden || meta.showMainRoute) {
+    if (!meta.hidden || meta.canTo) {
       const allParentPaht = getAllParentPath<AppRouteRecordRaw>(allRoutes, v.path)
       const allParentPaht = getAllParentPath<AppRouteRecordRaw>(allRoutes, v.path)
 
 
       const fullPath = isUrl(v.path) ? v.path : allParentPaht.join('/')
       const fullPath = isUrl(v.path) ? v.path : allParentPaht.join('/')

+ 3 - 3
src/router/index.ts

@@ -435,7 +435,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
           noTagsView: true,
           noTagsView: true,
           noCache: true,
           noCache: true,
           hidden: true,
           hidden: true,
-          showMainRoute: true,
+          canTo: true,
           activeMenu: '/example/example-page'
           activeMenu: '/example/example-page'
         }
         }
       },
       },
@@ -448,7 +448,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
           noTagsView: true,
           noTagsView: true,
           noCache: true,
           noCache: true,
           hidden: true,
           hidden: true,
-          showMainRoute: true,
+          canTo: true,
           activeMenu: '/example/example-page'
           activeMenu: '/example/example-page'
         }
         }
       },
       },
@@ -461,7 +461,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
           noTagsView: true,
           noTagsView: true,
           noCache: true,
           noCache: true,
           hidden: true,
           hidden: true,
-          showMainRoute: true,
+          canTo: true,
           activeMenu: '/example/example-page'
           activeMenu: '/example/example-page'
         }
         }
       }
       }

+ 1 - 1
src/utils/routerHelper.ts

@@ -43,7 +43,7 @@ export const generateRoutesFn1 = (
   for (const route of routes) {
   for (const route of routes) {
     const meta = route.meta as RouteMeta
     const meta = route.meta as RouteMeta
     // skip some route
     // skip some route
-    if (meta.hidden && !meta.showMainRoute) {
+    if (meta.hidden && !meta.canTo) {
       continue
       continue
     }
     }