日历优化
This commit is contained in:
parent
6cd778c5d3
commit
ac3d70f44f
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user