[update 首页] 翻译

This commit is contained in:
danshihao
2024-08-07 19:58:33 +08:00
parent c493db6d70
commit 2b17647c62
5 changed files with 51 additions and 13 deletions
+14 -1
View File
@@ -44,6 +44,12 @@ export default {
type: Array,
required: false,
default: () => []
},
// 是否返回区间,只选择一侧,另一侧会返回一个minDate或maxDate
returnInterval: {
type: Boolean,
required: false,
default: true
}
},
data () {
@@ -112,7 +118,14 @@ export default {
},
// 触发change事件
triggerChange () {
this.$emit('change', [this.startDate || minDate, this.endDate || maxDate])
const startDate = this.startDate || minDate
const endDate = this.endDate || maxDate
// 是否一侧为空时,返回最大日期或最小日期
if (this.returnInterval) {
this.$emit('change', [startDate, endDate])
} else {
this.$emit('change', [this.startDate, this.endDate])
}
},
// 记录最后一次点击的日期
clickCalendarDate (val) {