|
@@ -27,7 +27,7 @@ import { useRouter } from 'vue-router'
|
|
|
import { generateTitle } from '@/utils/i18n'
|
|
|
import PickerIcon from '@/components/IconPicker/PickerIcon.vue'
|
|
|
import { isExternal } from '@/utils/validate'
|
|
|
-import {ElMessage} from "element-plus";
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
|
defineProps<{ menuList: RouteMenu.Item[] }>()
|
|
|
|
|
@@ -40,14 +40,18 @@ const router = useRouter()
|
|
|
* @param subItem
|
|
|
*/
|
|
|
const handleClickMenu = (subItem: RouteMenu.Item) => {
|
|
|
- if (subItem.meta.type === 'iframe') {
|
|
|
- if (!isExternal(subItem.path)) return ElMessage.error(`当前路由 ${subItem.path} 不是外链地址,请检查配置~`)
|
|
|
- return window.open(subItem.path, '_blank')
|
|
|
- } else {
|
|
|
+ const { type } = subItem.meta
|
|
|
+ const isIframe = ['iframe', 'link'].includes(type) // true 外链 false 系统路由
|
|
|
+ if (!isIframe) {
|
|
|
router.push(subItem.path)
|
|
|
+ } else {
|
|
|
+ if (!isExternal(subItem.props.url)) return ElMessage.error(`当前Url不是外链地址,请检查重定向配置~`)
|
|
|
+ if (type === 'link') {
|
|
|
+ return window.open(subItem.redirect, '_blank')
|
|
|
+ } else {
|
|
|
+ router.push({ path: `${subItem.path}` })
|
|
|
+ }
|
|
|
}
|
|
|
- // router.push({ name: subItem.name })
|
|
|
- // router.push('/404')
|
|
|
}
|
|
|
</script>
|
|
|
|