日历优化

This commit is contained in:
XaoLi717 2024-12-10 14:24:21 +08:00
parent 6cd778c5d3
commit ac3d70f44f

View File

@ -153,6 +153,7 @@ const formDataCaln = ref({
// const data = await CalendarApi.createCalendar(dda)
// console.log(data)
// }
//
const isCurrentMonth = (date:any,index:number) => {
const SelectDate = date.date;
@ -252,6 +253,7 @@ const submitForm = async (date:any)=> {
//
updatedHoliday.visible = false;
}
const closePopover = async (date:any)=> {
//
await getDate(date);
@ -260,6 +262,7 @@ const closePopover = async (date:any)=> {
//
updatedHoliday.visible = false;
}
//
function formatDate2(dat: number|Date) {
const date = new Date(dat)
@ -268,6 +271,7 @@ function formatDate2(dat: number|Date) {
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
//
const selectDate = (val:number) => {
if (!val){
@ -275,15 +279,19 @@ const selectDate = (val:number) => {
}
currentYear.value += val
}
//toYear Button change data go to year
const toYear = () => {
currentYear.value = new Date().getFullYear()
}
//
onMounted( async ()=> {
await getListDate()
})
</script>
<!-- 样式很重要 -->
<style lang="scss">
.close-But {