feat(projects): 增加项目文档外链

This commit is contained in:
Yanbowen
2021-12-20 14:04:11 +08:00
parent 041012b3ee
commit 1901a0bfb7
5 changed files with 33 additions and 2 deletions

View File

@ -22,6 +22,7 @@ import type { MenuOption } from 'naive-ui';
import { useThemeStore, useAppStore } from '@/store';
import { menus } from '@/router';
import { GlobalMenuOption } from '@/interface';
import { isUrl } from '@/utils';
const theme = useThemeStore();
const app = useAppStore();
@ -49,7 +50,11 @@ function getActiveKeysInMenus(menu: GlobalMenuOption) {
function handleUpdateMenu(_key: string, item: MenuOption) {
const menuItem = item as GlobalMenuOption;
router.push(menuItem.routePath);
if (isUrl(menuItem.routePath)) {
window.open(menuItem.routePath, '__blank');
} else {
router.push(menuItem.routePath);
}
}
function handleUpdateExpandedKeys(keys: string[]) {