Skip to content

Commit 1048357

Browse files
committed
fix: types
1 parent 52755b3 commit 1048357

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/components/ConfigGlobal/src/ConfigGlobal.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
<script lang="ts" setup>
1+
<script setup lang="ts">
2+
import { provide, computed, watch, onMounted } from 'vue'
23
import { propTypes } from '@/utils/propTypes'
4+
import { ComponentSize, ElConfigProvider } from 'element-plus'
35
import { useLocaleStore } from '@/store/modules/locale'
6+
import { useWindowSize } from '@vueuse/core'
47
import { useAppStore } from '@/store/modules/app'
58
import { setCssVar } from '@/utils'
69
import { useDesign } from '@/hooks/web/useDesign'
7-
import { ElementPlusSize } from '@/types/elementPlus'
8-
import { useWindowSize } from '@vueuse/core'
9-
10-
defineOptions({ name: 'ConfigGlobal' })
1110
1211
const { variables } = useDesign()
1312
1413
const appStore = useAppStore()
1514
1615
const props = defineProps({
17-
size: propTypes.oneOf<ElementPlusSize>(['default', 'small', 'large']).def('default')
16+
size: propTypes.oneOf<ComponentSize>(['default', 'small', 'large']).def('default')
1817
})
1918
2019
provide('configGlobal', props)
@@ -53,9 +52,9 @@ const currentLocale = computed(() => localeStore.currentLocale)
5352

5453
<template>
5554
<ElConfigProvider
55+
:namespace="variables.elNamespace"
5656
:locale="currentLocale.elLocale"
5757
:message="{ max: 1 }"
58-
:namespace="variables.elNamespace"
5958
:size="size"
6059
>
6160
<slot></slot>

src/components/ShortcutDateRangePicker/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import * as DateUtil from '@/utils/formatTime'
2727
defineOptions({ name: 'ShortcutDateRangePicker' })
2828
2929
const shortcutDays = ref(7) // 日期快捷天数(单选按钮组), 默认7天
30-
const times = ref<[dayjs.ConfigType, dayjs.ConfigType]>(['', '']) // 时间范围参数
30+
const times = ref<[string, string]>(['', '']) // 时间范围参数
3131
defineExpose({ times }) // 暴露时间范围参数
3232
/** 日期快捷选择 */
3333
const shortcuts = [

src/utils/formatTime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,6 @@ export function getLast1Year(): [dayjs.ConfigType, dayjs.ConfigType] {
334334
export function getDateRange(
335335
beginDate: dayjs.ConfigType,
336336
endDate: dayjs.ConfigType
337-
): [dayjs.ConfigType, dayjs.ConfigType] {
338-
return [dayjs(beginDate).startOf('d'), dayjs(endDate).endOf('d')]
337+
): [string, string] {
338+
return [dayjs(beginDate).startOf('d').toString(), dayjs(endDate).endOf('d').toString()]
339339
}

0 commit comments

Comments
 (0)