Skip to content

Commit

Permalink
fix(date-picker): format date of slotProps and style of doc
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Feb 23, 2022
1 parent eb76b77 commit 67bf46c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/varlet-ui/src/date-picker/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,13 @@ export default defineComponent({
const slotProps: ComputedRef<Record<string, string>> = computed(() => {
const weekIndex = dayjs(`${chooseYear.value}-${chooseMonth.value?.index}-${chooseDay.value}`).day()
const date = chooseDay.value ? chooseDay.value?.padStart(2, '0') : ''
return {
week: `${weekIndex}`,
year: chooseYear.value ?? '',
month: chooseMonth.value?.index ?? '',
date: chooseDay.value ?? '',
date,
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/varlet-ui/src/date-picker/docs/en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default {
| ----- | -------------- | -------- |
| `year` | Custom the year in the title | `year: YYYY` |
| `month` | Custom the month in the title | `year: YYYY` <br> `month: MM` |
| `date` | Custom the date in the title | `year: YYYY` <br> `month: MM` `date: DD` <br> `week: weekIndex` |
| `date` | Custom the date in the title | `year: YYYY` <br> `month: MM` <br> `date: DD` <br> `week: weekIndex` |
| `range` | Custom the range in the title | `choose: [startData, endDate]` |
| `multiple` | Custom the multiple in the title | `choose: ['YYYY-MM-DD' \| 'YYYY-MM']` |

Expand Down
4 changes: 2 additions & 2 deletions packages/varlet-ui/src/date-picker/docs/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ export default {
| `change` | 日期变化时触发 | `value: string \| string[]` |

### 插槽
`weekIndex` 表示一周的第 `n` 天,从周末的`0`开始
`weekIndex` 表示一周的第 `n` 天,从周末的 `0` 开始

| 名称 | 说明 | 参数 |
| ----- | -------------- | -------- |
| `year` | 自定义标题中的年 | `year: YYYY` |
| `month` | 自定义标题中的月 | `year: YYYY` <br> `month: MM` |
| `date` | 自定义标题中的日期 | `year: YYYY` <br> `month: MM` `date: DD` <br> `week: weekIndex` |
| `date` | 自定义标题中的日期 | `year: YYYY` <br> `month: MM` <br> `date: DD` <br> `week: weekIndex` |
| `range` | 自定义标题中的范围 | `choose: [startData, endDate]` |
| `multiple` | 自定义标题中的多选 | `choose: ['YYYY-MM-DD' \| 'YYYY-MM']` |

Expand Down

0 comments on commit 67bf46c

Please sign in to comment.