hookehuyr

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

...@@ -158,12 +158,20 @@ onMounted(() => { ...@@ -158,12 +158,20 @@ onMounted(() => {
158 // 设置默认最大最小日期 158 // 设置默认最大最小日期
159 if (data_minvalue.split(" ")[0].length) { 159 if (data_minvalue.split(" ")[0].length) {
160 const min = data_minvalue.split(" ")[0].split("-") 160 const min = data_minvalue.split(" ")[0].split("-")
161 + if (date_format === 'YYYY-MM') {
162 + minDate.value = new Date(+min[0], +min[1] - 1)
163 + } else {
161 minDate.value = new Date(+min[0], +min[1] - 1, +min[2]) 164 minDate.value = new Date(+min[0], +min[1] - 1, +min[2])
162 } 165 }
166 + }
163 if (data_maxvalue.split(" ")[0].length) { 167 if (data_maxvalue.split(" ")[0].length) {
164 const max = data_maxvalue.split(" ")[0].split("-") 168 const max = data_maxvalue.split(" ")[0].split("-")
169 + if (date_format === 'YYYY-MM') {
170 + maxDate.value = new Date(+max[0], +max[1] - 1)
171 + } else {
165 maxDate.value = new Date(+max[0], +max[1] - 1, +max[2]) 172 maxDate.value = new Date(+max[0], +max[1] - 1, +max[2])
166 } 173 }
174 + }
167 }); 175 });
168 176
169 const required = props.item.component_props.required; 177 const required = props.item.component_props.required;
......