mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
docs(Calendar): fix inconsistencies between the document and "demo" (#13061)
This commit is contained in:
parent
e9539da08d
commit
eef8e0b0de
@ -43,7 +43,9 @@ export default {
|
|||||||
const date = ref('');
|
const date = ref('');
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
|
||||||
const formatDate = (date) => `${date.getMonth() + 1}/${date.getDate()}`;
|
const formatDate = (date) => {
|
||||||
|
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
|
||||||
|
};
|
||||||
const onConfirm = (value) => {
|
const onConfirm = (value) => {
|
||||||
show.value = false;
|
show.value = false;
|
||||||
date.value = formatDate(value);
|
date.value = formatDate(value);
|
||||||
@ -227,7 +229,7 @@ Use `position` to custom popup position, can be set to `top`、`left`、`right`.
|
|||||||
When selecting a date range, you can use the `max-range` prop to specify the maximum number of selectable days.
|
When selecting a date range, you can use the `max-range` prop to specify the maximum number of selectable days.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-calendar type="range" :max-range="3" :style="{ height: '500px' }" />
|
<van-calendar type="range" :max-range="3" />
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom First Day Of Week
|
### Custom First Day Of Week
|
||||||
|
@ -43,7 +43,9 @@ export default {
|
|||||||
const date = ref('');
|
const date = ref('');
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
|
||||||
const formatDate = (date) => `${date.getMonth() + 1}/${date.getDate()}`;
|
const formatDate = (date) => {
|
||||||
|
return `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
|
||||||
|
};
|
||||||
const onConfirm = (value) => {
|
const onConfirm = (value) => {
|
||||||
show.value = false;
|
show.value = false;
|
||||||
date.value = formatDate(value);
|
date.value = formatDate(value);
|
||||||
@ -231,7 +233,7 @@ export default {
|
|||||||
选择日期区间时,可以通过 `max-range` 属性来指定最多可选天数,选择的范围超过最多可选天数时,会弹出相应的提示文案。
|
选择日期区间时,可以通过 `max-range` 属性来指定最多可选天数,选择的范围超过最多可选天数时,会弹出相应的提示文案。
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<van-calendar type="range" :max-range="3" :style="{ height: '500px' }" />
|
<van-calendar type="range" :max-range="3" />
|
||||||
```
|
```
|
||||||
|
|
||||||
### 自定义周起始日
|
### 自定义周起始日
|
||||||
|
Loading…
x
Reference in New Issue
Block a user