1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2026-01-22 15:40:21 +08:00

feat: 外链可内嵌打开

This commit is contained in:
zclzone
2024-03-15 16:20:38 +08:00
parent fd9480e92f
commit 04723ffbfa
6 changed files with 86 additions and 5 deletions

View File

@@ -6,6 +6,8 @@
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
import { isExternal } from '@/utils'
import { hyphenate } from '@vueuse/core'
import { defineStore } from 'pinia'
export const usePermissionStore = defineStore('permission', {
@@ -31,6 +33,7 @@ export const usePermissionStore = defineStore('permission', {
label: route.meta.title,
key: route.name,
path: route.path,
originPath: route.meta.originPath,
icon: () => h('i', { class: `${route.meta.icon}?mask text-16` }),
order: item.order ?? 0,
}
@@ -45,12 +48,19 @@ export const usePermissionStore = defineStore('permission', {
return menuItem
},
generateRoute(item, parentKey) {
let originPath = undefined
if (isExternal(item.path)) {
originPath = item.path
item.component = '/src/views/iframe/index.vue'
item.path = `/iframe/${hyphenate(item.code)}`
}
return {
name: item.code,
path: item.path,
redirect: item.redirect,
component: item.component,
meta: {
originPath,
icon: item.icon,
title: item.name,
layout: item.layout,