mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 18:36:51 +08:00
docs(Calendar): update calendar examples (#5464)
This commit is contained in:
parent
fa9d55c9a9
commit
208433d6f8
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
### 选择日期区间
|
### 选择日期区间
|
||||||
@ -61,17 +60,22 @@ export default {
|
|||||||
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)}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
### 快捷选择
|
### 快捷选择
|
||||||
|
Loading…
x
Reference in New Issue
Block a user