From e4d9673a2bd86e013fbf86b2f6f2ee1715014227 Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Sun, 21 May 2023 10:42:50 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=9A=84=20type=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Notify/index.vue | 6 +++--- src/hooks/useFetchSelect.ts | 6 +++--- src/hooks/useTheme.ts | 6 +++--- src/layout/components/TagsView/index.vue | 22 +++++++++++----------- src/store/modules/tags-view.ts | 16 ++++++++-------- src/views/dashboard/index.vue | 4 ++-- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/components/Notify/index.vue b/src/components/Notify/index.vue index ae6c962..1a985c4 100644 --- a/src/components/Notify/index.vue +++ b/src/components/Notify/index.vue @@ -5,10 +5,10 @@ import { Bell } from "@element-plus/icons-vue" import NotifyList from "./NotifyList.vue" import { type ListItem, notifyData, messageData, todoData } from "./data" -type TabNameType = "通知" | "消息" | "待办" +type TabName = "通知" | "消息" | "待办" interface DataItem { - name: TabNameType + name: TabName type: "primary" | "success" | "warning" | "danger" | "info" list: ListItem[] } @@ -26,7 +26,7 @@ const badgeMax = 99 /** 面板宽度 */ const popoverWidth = 350 /** 当前 Tab */ -const activeName = ref("通知") +const activeName = ref("通知") /** 所有数据 */ const data = ref([ // 通知数据 diff --git a/src/hooks/useFetchSelect.ts b/src/hooks/useFetchSelect.ts index 846dbc5..0e04054 100644 --- a/src/hooks/useFetchSelect.ts +++ b/src/hooks/useFetchSelect.ts @@ -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(false) const options = ref([]) - const value = ref("") + const value = ref("") /** 调用接口获取数据 */ const loadData = () => { diff --git a/src/hooks/useTheme.ts b/src/hooks/useTheme.ts index f2785b9..6ab392e 100644 --- a/src/hooks/useTheme.ts +++ b/src/hooks/useTheme.ts @@ -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 diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index 15a3525..a9d796d 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -1,7 +1,7 @@