Browse Source

style: format code

nian 2 months ago
parent
commit
1f30781cbf

+ 1 - 1
src/composable/comp/useDataTable.ts

@@ -61,7 +61,7 @@ export function useDataTable<T extends ComponentPublicInstance>(
 
   function initTableResizeObserver() {
     if (!target.value) {
-      maxHeight.value = void 0
+      maxHeight.value = undefined
       return
     }
 

+ 3 - 1
src/layout/aside/index.vue

@@ -16,7 +16,9 @@ const menuInject = inject(menuInjectionKey, null)
 const configureStore = useConfigureStore()
 
 const menuCollapseWidth = computed(() =>
-  configureStore.configure.menuCollapsed ? menuInject?.collapse.width : menuInject?.collapse.maxWidth,
+  configureStore.configure.menuCollapsed
+    ? menuInject?.collapse.width
+    : menuInject?.collapse.maxWidth,
 )
 
 function handleCollapseClick() {

+ 2 - 1
src/layout/component/Tabs.vue

@@ -419,7 +419,8 @@ onMounted(() => {
                   :class="[
                     tab.icon,
                     {
-                      'text-primary': tab.componentName && tabsKeepAlive.includes(tab.componentName),
+                      'text-primary':
+                        tab.componentName && tabsKeepAlive.includes(tab.componentName),
                     },
                   ]"
                 />

+ 1 - 1
src/layout/header/Breadcrumb.vue

@@ -20,7 +20,7 @@ function resolveDropdownOptions(route: RouteRecordRaw[]): DropdownProps['options
       icon: () => h('span', { class: `${item.meta?.icon} size-5` }),
       children: !isEmpty(item.children)
         ? resolveDropdownOptions(item.children as RouteRecordRaw[])
-        : void 0,
+        : undefined,
     }
   })
 }

+ 3 - 1
src/layout/header/Logo.vue

@@ -11,7 +11,9 @@ const menuInject = inject(menuInjectionKey, null)
 const configureStore = useConfigureStore()
 
 const collapseWidth = computed(() => {
-  return configureStore.configure.menuCollapsed ? menuInject?.collapse.width : menuInject?.collapse.maxWidth
+  return configureStore.configure.menuCollapsed
+    ? menuInject?.collapse.width
+    : menuInject?.collapse.maxWidth
 })
 </script>
 <template>

+ 1 - 4
src/layout/main/index.vue

@@ -11,7 +11,6 @@ import { useTabsStore } from '@/stores/tabs'
 
 import type { Tab } from '@/stores/tabs'
 import type { RouteLocationNormalizedLoaded } from 'vue-router'
-import { csCZ } from 'naive-ui'
 
 defineOptions({
   name: 'MainLayout',
@@ -115,15 +114,13 @@ watch(
 onMounted(() => {
   const currentRoute = router.currentRoute.value
   const { name, meta } = currentRoute
-  console.log(tabs.value)
+
   const findTab = tabs.value.find((item) => item.name === name)
   const { showTab, multiTab } = meta
 
   if (name === 'layout' && tabActiveKey.value) {
     router.replace(tabActiveKey.value)
   } else if (showTab && (!findTab || multiTab)) {
-    console.log(!findTab, multiTab)
-
     doCreateTab(currentRoute)
   } else if (!isEmpty(findTab)) {
     setActive(findTab.key)

+ 1 - 1
src/stores/configure.ts

@@ -52,7 +52,7 @@ const DEFAULT_CONFIGURE_OPTIONS: ConfigureOptions = {
     fontStyle: 'normal',
     fontWeight: 400,
     lineHeight: 16,
-    image: void 0,
+    image: undefined,
     imageHeight: 64,
     imageWidth: 64,
     imageOpacity: 0.5,

+ 2 - 2
src/stores/tabs.ts

@@ -169,12 +169,12 @@ export const useTabsStore = defineStore('tabsStore', () => {
 
   const isPinned = (key: string) => {
     const index = findTabIndex(key)
-    return index !== -1 ? tabs.value[index].pinned : void 0
+    return index !== -1 ? tabs.value[index].pinned : undefined
   }
 
   const isLocked = (key: string) => {
     const index = findTabIndex(key)
-    return index !== -1 ? tabs.value[index].locked : void 0
+    return index !== -1 ? tabs.value[index].locked : undefined
   }
 
   const setLocked = (key: string) => {