docs(Calendar): update calendar examples #5444 (#5465)

Update english doc
This commit is contained in:
mypridelife 2020-01-03 16:06:52 +08:00 committed by neverland
parent 208433d6f8
commit 783e30361f

View File

@ -35,16 +35,15 @@ export default {
}, },
methods: { methods: {
formatDate() { formatDate(date) {
return `${date.getMonth() + 1}/${date.getDate()}`; return `${date.getMonth() + 1}/${date.getDate()}`;
}, },
onConfirm(date) { onConfirm(date) {
const [start, end] = date;
this.show = false; this.show = false;
this.date = `${this.formatDate(start)} - ${this.formatDate(end)}`; this.date = this.formatDate(date);
} }
} }
} };
``` ```
### Select Date Range ### Select Date Range
@ -61,17 +60,22 @@ You can select a date range after setting `type` to` range`. In range mode, the
export default { export default {
data() { data() {
return { return {
show: false, date: '',
date: [] show: false
}; };
}, },
methods: { methods: {
formatDate(date) {
return `${date.getMonth() + 1}/${date.getDate()}`;
},
onConfirm(date) { onConfirm(date) {
const [start, end] = date;
this.show = false; this.show = false;
this.date = date; this.date = `${this.formatDate(start)} - ${this.formatDate(end)}`;
} }
} }
} };
``` ```
### Quick Select ### Quick Select