style: lint fix

This commit is contained in:
zclzone
2023-05-07 22:05:13 +08:00
parent 6d863e1a63
commit ebffe52c7c
20 changed files with 146 additions and 30 deletions

View File

@@ -1,7 +1,11 @@
<template>
<router-view v-slot="{ Component, route }">
<KeepAlive :include="keepAliveRouteNames">
<component :is="Component" v-if="appStore.reloadFlag" :key="appStore.aliveKeys[route.name] || route.fullPath" />
<component
:is="Component"
v-if="appStore.reloadFlag"
:key="appStore.aliveKeys[route.name] || route.fullPath"
/>
</KeepAlive>
</router-view>
</template>

View File

@@ -53,7 +53,9 @@ function getMenuItem(route, basePath = '') {
order: route.meta?.order || 0,
}
const visibleChildren = route.children ? route.children.filter((item) => item.name && !item.isHidden) : []
const visibleChildren = route.children
? route.children.filter((item) => item.name && !item.isHidden)
: []
if (!visibleChildren.length) return menuItem
@@ -67,12 +69,16 @@ function getMenuItem(route, basePath = '') {
path: resolvePath(menuItem.path, singleRoute.path),
icon: getIcon(singleRoute.meta),
}
const visibleItems = singleRoute.children ? singleRoute.children.filter((item) => item.name && !item.isHidden) : []
const visibleItems = singleRoute.children
? singleRoute.children.filter((item) => item.name && !item.isHidden)
: []
if (visibleItems.length === 1) {
menuItem = getMenuItem(visibleItems[0], menuItem.path)
} else if (visibleItems.length > 1) {
menuItem.children = visibleItems.map((item) => getMenuItem(item, menuItem.path)).sort((a, b) => a.order - b.order)
menuItem.children = visibleItems
.map((item) => getMenuItem(item, menuItem.path))
.sort((a, b) => a.order - b.order)
}
} else {
menuItem.children = visibleChildren

View File

@@ -67,7 +67,9 @@ const options = computed(() => [
{
label: '关闭右侧',
key: 'close-right',
disabled: tagsStore.tags.length <= 1 || props.currentPath === tagsStore.tags[tagsStore.tags.length - 1].path,
disabled:
tagsStore.tags.length <= 1 ||
props.currentPath === tagsStore.tags[tagsStore.tags.length - 1].path,
icon: renderIcon('mdi:arrow-expand-right', { size: '14px' }),
},
])