fix(实时信息): 修复日历组件默认日期和响应式日期问题
将minDate和maxDate改为ref响应式变量 添加日历组件的default-date属性和key绑定
This commit is contained in:
parent
680f074c37
commit
18ed8d531a
|
|
@ -117,7 +117,9 @@
|
||||||
min-date="2025-01-01"
|
min-date="2025-01-01"
|
||||||
closeOnClickOverlay
|
closeOnClickOverlay
|
||||||
:max-date="maxDate"
|
:max-date="maxDate"
|
||||||
|
:default-date="chooseDate.startDate"
|
||||||
monthNum="12"
|
monthNum="12"
|
||||||
|
:key="chooseDate.startDate"
|
||||||
@confirm="calendarConfirm"
|
@confirm="calendarConfirm"
|
||||||
@close="calendarShow = false">
|
@close="calendarShow = false">
|
||||||
</u-calendar>
|
</u-calendar>
|
||||||
|
|
@ -149,8 +151,8 @@ const year = d.getFullYear();
|
||||||
let month = d.getMonth() + 1;
|
let month = d.getMonth() + 1;
|
||||||
month = month < 10 ? `0${month}` : month;
|
month = month < 10 ? `0${month}` : month;
|
||||||
const date = d.getDate();
|
const date = d.getDate();
|
||||||
const maxDate = `${year}-${month}-${date} 23:59:59`;
|
const maxDate = ref(`${year}-${month}-${date} 23:59:59`);
|
||||||
const minDate = `${year}-${month}-${date}`;
|
const minDate = ref(`${year}-${month}-${date}`);
|
||||||
|
|
||||||
const calendarShow = ref(false);
|
const calendarShow = ref(false);
|
||||||
const newsList = ref([]);
|
const newsList = ref([]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue