Skip to content

Commit

Permalink
fix: change showMainRoute to canTo
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Jun 30, 2022
1 parent 7fb38b9 commit 5e292f8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
28 changes: 14 additions & 14 deletions package.json
Expand Up @@ -27,7 +27,7 @@
},
"dependencies": {
"@iconify/iconify": "^2.2.1",
"@vueuse/core": "^8.7.4",
"@vueuse/core": "^8.7.5",
"@wangeditor/editor": "^5.1.1",
"@wangeditor/editor-for-vue": "^5.1.10",
"@zxcvbn-ts/core": "^2.0.1",
Expand All @@ -45,7 +45,7 @@
"pinia": "^2.0.14",
"pinia-plugin-persist": "^1.0.0",
"qrcode": "^1.5.0",
"qs": "^6.10.5",
"qs": "^6.11.0",
"url": "^0.11.0",
"vue": "3.2.37",
"vue-i18n": "9.1.10",
Expand All @@ -54,9 +54,9 @@
"web-storage-cache": "^1.1.1"
},
"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",
"@purge-icons/generated": "^0.8.1",
"@types/intro.js": "^3.0.2",
Expand All @@ -66,26 +66,26 @@
"@types/nprogress": "^0.2.0",
"@types/qrcode": "^1.4.2",
"@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-jsx": "^1.3.10",
"autoprefixer": "^10.4.7",
"eslint": "^8.18.0",
"eslint-config-prettier": "^8.5.0",
"eslint-define-config": "^1.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.1.1",
"husky": "^8.0.1",
"less": "^4.1.3",
"lint-staged": "^13.0.2",
"lint-staged": "^13.0.3",
"plop": "^3.1.1",
"postcss": "^8.4.14",
"postcss-html": "^1.4.1",
"postcss-less": "^6.0.0",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"rollup": "^2.75.6",
"rollup": "^2.75.7",
"stylelint": "^14.9.1",
"stylelint-config-html": "^1.0.0",
"stylelint-config-prettier": "^9.0.3",
Expand All @@ -94,16 +94,16 @@
"stylelint-order": "^5.0.0",
"typescript": "4.7.4",
"unplugin-vue-define-options": "^0.6.1",
"vite": "2.9.12",
"vite": "2.9.13",
"vite-plugin-eslint": "^1.6.1",
"vite-plugin-html": "^3.2.0",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-purge-icons": "^0.8.1",
"vite-plugin-style-import": "^1.4.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"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Breadcrumb/src/helper.ts
Expand Up @@ -9,7 +9,7 @@ export const filterBreadcrumb = (

for (const route of routes) {
const meta = route?.meta as RouteMeta
if (meta.hidden && !meta.showMainRoute) {
if (meta.hidden && !meta.canTo) {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/TabMenu/src/helper.ts
Expand Up @@ -27,7 +27,7 @@ export const filterMenusPath = (
for (const v of routes) {
let data: Nullable<AppRouteRecordRaw> = null
const meta = (v.meta ?? {}) as RouteMeta
if (!meta.hidden || meta.showMainRoute) {
if (!meta.hidden || meta.canTo) {
const allParentPaht = getAllParentPath<AppRouteRecordRaw>(allRoutes, v.path)

const fullPath = isUrl(v.path) ? v.path : allParentPaht.join('/')
Expand Down
6 changes: 3 additions & 3 deletions src/router/index.ts
Expand Up @@ -435,7 +435,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
noTagsView: true,
noCache: true,
hidden: true,
showMainRoute: true,
canTo: true,
activeMenu: '/example/example-page'
}
},
Expand All @@ -448,7 +448,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
noTagsView: true,
noCache: true,
hidden: true,
showMainRoute: true,
canTo: true,
activeMenu: '/example/example-page'
}
},
Expand All @@ -461,7 +461,7 @@ export const asyncRouterMap: AppRouteRecordRaw[] = [
noTagsView: true,
noCache: true,
hidden: true,
showMainRoute: true,
canTo: true,
activeMenu: '/example/example-page'
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/routerHelper.ts
Expand Up @@ -43,7 +43,7 @@ export const generateRoutesFn1 = (
for (const route of routes) {
const meta = route.meta as RouteMeta
// skip some route
if (meta.hidden && !meta.showMainRoute) {
if (meta.hidden && !meta.canTo) {
continue
}

Expand Down

0 comments on commit 5e292f8

Please sign in to comment.