|
|
@ -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 { ColumnInj, ReadonlyInj } from '~/context' |
|
|
|
import { ColumnInj, 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: string |
|
|
|
modelValue: string |
|
|
|
} |
|
|
|
} |
|
|
@ -38,7 +35,7 @@ const localState = $computed({ |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (val?.isValid()) { |
|
|
|
if (val.isValid()) { |
|
|
|
emit('update:modelValue', val?.format('YYYY-MM-DD')) |
|
|
|
emit('update:modelValue', val?.format('YYYY-MM-DD')) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|