fix: 多余的reloadPage

This commit is contained in:
张传龙 2023-07-13 14:46:41 +08:00
parent d702a6703b
commit 8f15e1c655

View File

@ -13,13 +13,12 @@
</template> </template>
<script setup> <script setup>
import { usePermissionStore, useAppStore } from '@/store' import { usePermissionStore } from '@/store'
import { renderCustomIcon, renderIcon, isExternal } from '@/utils' import { renderCustomIcon, renderIcon, isExternal } from '@/utils'
const router = useRouter() const router = useRouter()
const curRoute = useRoute() const curRoute = useRoute()
const permissionStore = usePermissionStore() const permissionStore = usePermissionStore()
const appStore = useAppStore()
const activeKey = computed(() => curRoute.meta?.activeMenu || curRoute.name) const activeKey = computed(() => curRoute.meta?.activeMenu || curRoute.name)
@ -97,13 +96,9 @@ function getIcon(meta) {
function handleMenuSelect(key, item) { function handleMenuSelect(key, item) {
if (isExternal(item.path)) { if (isExternal(item.path)) {
window.open(item.path) window.open(item.path)
} else {
if (item.path === curRoute.path) {
appStore.reloadPage()
} else { } else {
router.push(item.path) router.push(item.path)
} }
}
} }
</script> </script>