diff --git a/README.md b/README.md index c76b079f3..a834e5484 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ If you need a basic template, please switch to the `tempalte` branch. `Tempalte` ## Preview - [vue-element-plus-admin](https://element-plus-admin.cn/) - Full version of the github site +- [vue-element-plus-admin](https://kailong110120130.gitee.io/vue-element-plus-admin) - Full version of the gitee site account: **admin/admin test/test** @@ -38,7 +39,7 @@ account: **admin/admin test/test** ## Documentation -[Document](https://element-plus-admin.cn/) +[Document Github](https://element-plus-admin.cn/) [Document Gitee](https://kailong110120130.gitee.io/vue-element-plus-admin-doc) ## Preparation diff --git a/README.zh-CN.md b/README.zh-CN.md index 06988101e..7cdab8f1b 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -29,6 +29,7 @@ vue-element-plus-admin 的定位是后台集成方案,不太适合当基础模 ## 预览 - [vue-element-plus-admin](https://element-plus-admin.cn/) - 完整版 github 站点 +- [vue-element-plus-admin](https://kailong110120130.gitee.io/vue-element-plus-admin) - 完整版 gitee 站点 帐号:**admin/admin test/test** @@ -38,7 +39,7 @@ vue-element-plus-admin 的定位是后台集成方案,不太适合当基础模 ## 文档 -[文档地址](https://element-plus-admin-doc.cn/) +[文档地址 Github](https://element-plus-admin-doc.cn/) [文档地址 Gitee](https://kailong110120130.gitee.io/vue-element-plus-admin-doc) ## 前序准备 diff --git a/mock/role/index.ts b/mock/role/index.ts index 8c32c8b2c..921c288da 100644 --- a/mock/role/index.ts +++ b/mock/role/index.ts @@ -37,6 +37,22 @@ const adminList = [ } ] }, + { + path: '/external-link', + component: '#', + meta: {}, + name: 'ExternalLink', + children: [ + { + path: 'https://element-plus-admin-doc.cn/', + name: 'DocumentLink', + meta: { + title: 'router.document', + icon: 'clarity:document-solid' + } + } + ] + }, { path: '/guide', component: '#', @@ -414,6 +430,8 @@ const testList: string[] = [ '/dashboard', '/dashboard/analysis', '/dashboard/workplace', + 'external-link', + 'https://element-plus-admin-doc.cn/', '/guide', '/guide/index', '/components', diff --git a/src/components/Menu/src/Menu.vue b/src/components/Menu/src/Menu.vue index d84df6fec..154147e1d 100644 --- a/src/components/Menu/src/Menu.vue +++ b/src/components/Menu/src/Menu.vue @@ -61,6 +61,7 @@ export default defineComponent({ props.menuSelect(index) } // 自定义事件 + console.log(index) if (isUrl(index)) { window.open(index) } else { diff --git a/src/components/Menu/src/components/useRenderMenuItem.tsx b/src/components/Menu/src/components/useRenderMenuItem.tsx index a1b857537..4e785d232 100644 --- a/src/components/Menu/src/components/useRenderMenuItem.tsx +++ b/src/components/Menu/src/components/useRenderMenuItem.tsx @@ -15,7 +15,6 @@ export const useRenderMenuItem = ( const meta = (v.meta ?? {}) as RouteMeta if (!meta.hidden) { const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v) - const fullPath = isUrl(v.path) ? v.path : getAllParentPath(allRouters, v.path).join('/') diff --git a/src/components/TabMenu/src/TabMenu.vue b/src/components/TabMenu/src/TabMenu.vue index 2869845ea..772b87366 100644 --- a/src/components/TabMenu/src/TabMenu.vue +++ b/src/components/TabMenu/src/TabMenu.vue @@ -11,6 +11,7 @@ import { pathResolve } from '@/utils/routerHelper' import { cloneDeep } from 'lodash-es' import { filterMenusPath, initTabMap, tabPathMap } from './helper' import { useDesign } from '@/hooks/web/useDesign' +import { isUrl } from '@/utils/is' const { getPrefixCls, variables } = useDesign() @@ -72,6 +73,10 @@ export default defineComponent({ // tab点击事件 const tabClick = (item: AppRouteRecordRaw) => { + if (isUrl(item.path)) { + window.open(item.path) + return + } tabActive.value = item.children ? item.path : item.path.split('/')[0] if (item.children) { showMenu.value = !unref(showMenu) diff --git a/src/components/UserInfo/src/UserInfo.vue b/src/components/UserInfo/src/UserInfo.vue index 791dfa833..882b911c2 100644 --- a/src/components/UserInfo/src/UserInfo.vue +++ b/src/components/UserInfo/src/UserInfo.vue @@ -6,6 +6,9 @@ import { resetRouter } from '@/router' import { useRouter } from 'vue-router' import { loginOutApi } from '@/api/login' import { useDesign } from '@/hooks/web/useDesign' +import { useTagsViewStore } from '@/store/modules/tagsView' + +const tagsViewStore = useTagsViewStore() const { getPrefixCls } = useDesign() @@ -27,12 +30,17 @@ const loginOut = () => { const res = await loginOutApi().catch(() => {}) if (res) { wsCache.clear() + tagsViewStore.delAllViews() resetRouter() // 重置静态路由表 replace('/login') } }) .catch(() => {}) } + +const toDocument = () => { + window.open('https://element-plus-admin-doc.cn/') +}