|
|
@ -1,14 +1,11 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
<script setup lang="ts"> |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import dayjs from 'dayjs' |
|
|
|
import customParseFormat from 'dayjs/plugin/customParseFormat' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { ReadonlyInj } from '~/context' |
|
|
|
import { ReadonlyInj } from '~/context' |
|
|
|
|
|
|
|
|
|
|
|
const { modelValue } = defineProps<Props>() |
|
|
|
const { modelValue } = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
|
|
|
|
|
|
|
|
dayjs.extend(customParseFormat) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
modelValue: number |
|
|
|
modelValue: number |
|
|
|
} |
|
|
|
} |
|
|
@ -38,7 +35,7 @@ const localState = $computed({ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (val?.isValid()) { |
|
|
|
if (val?.isValid()) { |
|
|
|
emit('update:modelValue', Number(val?.format('YYYY'))) |
|
|
|
emit('update:modelValue', Number(val.format('YYYY'))) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|