hookehuyr

🐞 fix(日期时间组件): 最大最小值设置,需要区分日期格式

......@@ -158,12 +158,20 @@ onMounted(() => {
// 设置默认最大最小日期
if (data_minvalue.split(" ")[0].length) {
const min = data_minvalue.split(" ")[0].split("-")
if (date_format === 'YYYY-MM') {
minDate.value = new Date(+min[0], +min[1] - 1)
} else {
minDate.value = new Date(+min[0], +min[1] - 1, +min[2])
}
}
if (data_maxvalue.split(" ")[0].length) {
const max = data_maxvalue.split(" ")[0].split("-")
if (date_format === 'YYYY-MM') {
maxDate.value = new Date(+max[0], +max[1] - 1)
} else {
maxDate.value = new Date(+max[0], +max[1] - 1, +max[2])
}
}
});
const required = props.item.component_props.required;
......