feat(Calendar): support max-range when type is multiple (#6202)

* feat(Calendar): support max-range when type is multiple

* docs: fix version tag
This commit is contained in:
neverland
2020-05-03 09:11:14 +08:00
committed by GitHub
parent 8348819cc8
commit 3cda85e122
4 changed files with 45 additions and 4 deletions
+2
View File
@@ -293,6 +293,8 @@ export default createComponent({
if (selected) {
const [unselectedDate] = currentDate.splice(selectedIndex, 1);
this.$emit('unselect', copyDate(unselectedDate));
} else if (this.maxRange && currentDate.length >= this.maxRange) {
Toast(this.rangePrompt || t('rangePrompt', this.maxRange));
} else {
this.select([...currentDate, date]);
}