perf: 代码优化 所有的 type 类型命名
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user