|
@@ -20,6 +20,7 @@
|
|
|
<script lang="ts">
|
|
|
import type { MenuState } from './types';
|
|
|
import type { Menu as MenuType } from '/@/router/types';
|
|
|
+ import type { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
|
|
|
|
import { defineComponent, computed, ref, unref, reactive, toRefs, watch } from 'vue';
|
|
|
import { useDesign } from '/@/hooks/web/useDesign';
|
|
@@ -29,8 +30,9 @@
|
|
|
import { listenerRouteChange } from '/@/logics/mitt/routeChange';
|
|
|
import { propTypes } from '/@/utils/propTypes';
|
|
|
import { REDIRECT_NAME } from '/@/router/constant';
|
|
|
- import { RouteLocationNormalizedLoaded, useRouter } from 'vue-router';
|
|
|
- import { isFunction } from '/@/utils/is';
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
+ import { isFunction, isUrl } from '/@/utils/is';
|
|
|
+ import { openWindow } from '/@/utils';
|
|
|
|
|
|
import { useOpenKeys } from './useOpenKeys';
|
|
|
export default defineComponent({
|
|
@@ -127,11 +129,16 @@
|
|
|
}
|
|
|
|
|
|
async function handleSelect(key: string) {
|
|
|
+ if (isUrl(key)) {
|
|
|
+ openWindow(key);
|
|
|
+ return;
|
|
|
+ }
|
|
|
const { beforeClickFn } = props;
|
|
|
if (beforeClickFn && isFunction(beforeClickFn)) {
|
|
|
const flag = await beforeClickFn(key);
|
|
|
if (!flag) return;
|
|
|
}
|
|
|
+
|
|
|
emit('menuClick', key);
|
|
|
|
|
|
isClickGo.value = true;
|