|
@@ -38,18 +38,21 @@ const currentDay: number = new Date().getDate();
|
|
|
const selectYear = ref<string>(currentYear.toString());
|
|
|
const selectMonth = ref<string>(currentMonth.toString());
|
|
|
|
|
|
-const currentDateTime = ref<string>()
|
|
|
+const currentDateTime = ref<string>('')
|
|
|
const selectDateTime = ref<string[]>([])
|
|
|
if (props.modelValue) {
|
|
|
selectDateTime.value = formatDateTimeArr(props.modelValue);
|
|
|
+ currentDateTime.value = props.modelValue
|
|
|
} else {
|
|
|
selectDateTime.value = [currentYear.toString(), fillZero(currentMonth), fillZero(currentDay)]
|
|
|
}
|
|
|
watch(() => props.modelValue, (newVal) => {
|
|
|
if(!newVal){
|
|
|
+ currentDateTime.value = ''
|
|
|
selectDateTime.value = [currentYear.toString(), fillZero(currentMonth), fillZero(currentDay)]
|
|
|
return;
|
|
|
}
|
|
|
+ currentDateTime.value = newVal
|
|
|
const newArr = formatDateTimeArr(newVal);
|
|
|
selectDateTime.value = newArr
|
|
|
selectYear.value = newArr[0].toString()
|