perf: 代码优化 所有的 type 类型命名

This commit is contained in:
pany
2023-05-21 10:42:50 +08:00
parent 05712f4adc
commit e4d9673a2b
6 changed files with 30 additions and 30 deletions

View File

@@ -1,10 +1,10 @@
import { ref, onMounted } from "vue"
type OptionValueType = string | number
type OptionValue = string | number
/** Select 需要的数据格式 */
interface SelectOption {
value: OptionValueType
value: OptionValue
label: string
disabled?: boolean
}
@@ -26,7 +26,7 @@ export function useFetchSelect(props: FetchSelectProps) {
const loading = ref<boolean>(false)
const options = ref<SelectOption[]>([])
const value = ref<OptionValueType>("")
const value = ref<OptionValue>("")
/** 调用接口获取数据 */
const loadData = () => {

View File

@@ -2,10 +2,10 @@ import { ref, watchEffect } from "vue"
import { getActiveThemeName, setActiveThemeName } from "@/utils/cache/localStorage"
const DEFAULT_THEME_NAME = "normal"
type DefaultThemeNameType = typeof DEFAULT_THEME_NAME
type DefaultThemeName = typeof DEFAULT_THEME_NAME
/** 注册的主题名称, 其中 DefaultThemeNameType 是必填的 */
export type ThemeName = DefaultThemeNameType | "dark" | "dark-blue"
/** 注册的主题名称, 其中 DefaultThemeName 是必填的 */
export type ThemeName = DefaultThemeName | "dark" | "dark-blue"
interface ThemeList {
title: string