|
@@ -40,16 +40,17 @@ const selectMonth = ref<string>(currentMonth.toString());
|
|
|
|
|
|
const currentDateTime = ref<string>('')
|
|
|
const selectDateTime = ref<string[]>([])
|
|
|
+const defaultDateTime: string[] = [currentYear.toString(), fillZero(currentMonth), fillZero(currentDay), '00', '00']
|
|
|
if (props.modelValue) {
|
|
|
selectDateTime.value = formatDateTimeArr(props.modelValue);
|
|
|
currentDateTime.value = props.modelValue
|
|
|
} else {
|
|
|
- selectDateTime.value = [currentYear.toString(), fillZero(currentMonth), fillZero(currentDay)]
|
|
|
+ selectDateTime.value = defaultDateTime
|
|
|
}
|
|
|
watch(() => props.modelValue, (newVal) => {
|
|
|
if(!newVal){
|
|
|
currentDateTime.value = ''
|
|
|
- selectDateTime.value = [currentYear.toString(), fillZero(currentMonth), fillZero(currentDay)]
|
|
|
+ selectDateTime.value = defaultDateTime
|
|
|
return;
|
|
|
}
|
|
|
currentDateTime.value = newVal
|