feat: types优化

This commit is contained in:
hongxinzz 2022-10-10 10:18:28 +08:00
parent ef3e006859
commit 33511553cd
6 changed files with 22 additions and 20 deletions

View File

@ -3,6 +3,7 @@ import type { Slots } from 'vue'
import { getSlot } from '@/utils/tsxHelper' import { getSlot } from '@/utils/tsxHelper'
import { PlaceholderMoel } from './types' import { PlaceholderMoel } from './types'
import { FormSchema } from '@/types/form' import { FormSchema } from '@/types/form'
import { ColProps } from '@/types/components'
const { t } = useI18n() const { t } = useI18n()

View File

@ -3,7 +3,7 @@ import { PropType } from 'vue'
import { Highlight } from '@/components/Highlight' import { Highlight } from '@/components/Highlight'
import { useDesign } from '@/hooks/web/useDesign' import { useDesign } from '@/hooks/web/useDesign'
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { TipSchema } from '@/types/infoTip'; import { TipSchema } from '@/types/infoTip'
const { getPrefixCls } = useDesign() const { getPrefixCls } = useDesign()

View File

@ -3,11 +3,11 @@ import { computed, defineComponent, unref, PropType } from 'vue'
import { ElMenu, ElScrollbar } from 'element-plus' import { ElMenu, ElScrollbar } from 'element-plus'
import { useAppStore } from '@/store/modules/app' import { useAppStore } from '@/store/modules/app'
import { usePermissionStore } from '@/store/modules/permission' import { usePermissionStore } from '@/store/modules/permission'
import type { LayoutType } from '@/config/app'
import { useRenderMenuItem } from './components/useRenderMenuItem' import { useRenderMenuItem } from './components/useRenderMenuItem'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { isUrl } from '@/utils/is' import { isUrl } from '@/utils/is'
import { useDesign } from '@/hooks/web/useDesign' import { useDesign } from '@/hooks/web/useDesign'
import { LayoutType } from '@/types/layout'
const { getPrefixCls } = useDesign() const { getPrefixCls } = useDesign()

View File

@ -4,27 +4,11 @@ import { setCssVar, humpToUnderline } from '@/utils'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { ElementPlusSize } from '@/types/elementPlus' import { ElementPlusSize } from '@/types/elementPlus'
import { useCache } from '@/hooks/web/useCache' import { useCache } from '@/hooks/web/useCache'
import { LayoutType } from '@/types/layout'
import { ThemeTypes } from '@/types/theme'
const { wsCache } = useCache() const { wsCache } = useCache()
type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
type ThemeTypes = {
elColorPrimary?: string
leftMenuBorderColor?: string
leftMenuBgColor?: string
leftMenuBgLightColor?: string
leftMenuBgActiveColor?: string
leftMenuCollapseBgActiveColor?: string
leftMenuTextColor?: string
leftMenuTextActiveColor?: string
logoTitleTextColor?: string
logoBorderColor?: string
topHeaderBgColor?: string
topHeaderTextColor?: string
topHeaderHoverColor?: string
topToolBorderColor?: string
}
interface AppState { interface AppState {
breadcrumb: boolean breadcrumb: boolean
breadcrumbIcon: boolean breadcrumbIcon: boolean

1
src/types/layout.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'

16
src/types/theme.d.ts vendored Normal file
View File

@ -0,0 +1,16 @@
export type ThemeTypes = {
elColorPrimary?: string
leftMenuBorderColor?: string
leftMenuBgColor?: string
leftMenuBgLightColor?: string
leftMenuBgActiveColor?: string
leftMenuCollapseBgActiveColor?: string
leftMenuTextColor?: string
leftMenuTextActiveColor?: string
logoTitleTextColor?: string
logoBorderColor?: string
topHeaderBgColor?: string
topHeaderTextColor?: string
topHeaderHoverColor?: string
topToolBorderColor?: string
}