refactor(projects): remove enum

This commit is contained in:
Soybean
2023-02-23 08:38:03 +08:00
parent 44b544745d
commit 21d5214247
31 changed files with 323 additions and 240 deletions

View File

@@ -3,7 +3,7 @@ import { breakpointsTailwind, useBreakpoints } from '@vueuse/core';
import { useAppStore, useThemeStore } from '@/store';
type LayoutMode = 'vertical' | 'horizontal';
type LayoutHeaderProps = Record<EnumType.ThemeLayoutMode, App.GlobalHeaderProps>;
type LayoutHeaderProps = Record<UnionKey.ThemeLayoutMode, App.GlobalHeaderProps>;
export function useBasicLayout() {
const app = useAppStore();

View File

@@ -42,8 +42,8 @@ export function useRouterPush(inSetup = true) {
* @param loginModule - 展示的登录模块
* @param redirectUrl - 重定向地址(登录成功后跳转的地址),默认undefined表示取当前地址为重定向地址
*/
function toLogin(loginModule?: EnumType.LoginModuleKey, redirectUrl?: string) {
const module: EnumType.LoginModuleKey = loginModule || 'pwd-login';
function toLogin(loginModule?: UnionKey.LoginModule, redirectUrl?: string) {
const module: UnionKey.LoginModule = loginModule || 'pwd-login';
const routeLocation: RouteLocationRaw = {
name: routeName('login'),
params: { module }
@@ -57,7 +57,7 @@ export function useRouterPush(inSetup = true) {
* 登录页切换其他模块
* @param module - 切换后的登录模块
*/
function toLoginModule(module: EnumType.LoginModuleKey) {
function toLoginModule(module: UnionKey.LoginModule) {
const { query } = route.value;
routerPush({ name: routeName('login'), params: { module }, query });
}