Skip to content

Commit 444e594

Browse files
committed
docs: 添加 default-datetime 属性文档
1 parent 72f5bb3 commit 444e594

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

docs/api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
| 属性 | 说明 | 类型 | 默认 | 是否必传 |
66
| :-------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------: | :------: |
77
| visible | 控制日历组件的显示或隐藏,需使用 `v-model:visible` | Boolean | false ||
8-
| scrollChangeDate | 控制滑动的时候是否修改选中的日期 | Boolean | true ||
8+
| scroll-change-date | 控制滑动的时候是否修改选中的日期 | Boolean | true ||
99
| model | 日历组件以哪种形式展示。inline:内联的方式。dialog:弹窗的方式 | String | inline ||
10-
| defaultDatetime | 指定默认时间。 | Date | 当前时间 ||
10+
| default-datetime | 指定默认时间。 | Date | 当前时间 ||
1111
| minDate | 指定日历最小日期范围,设置之后只能在该范围内滑动日历。 | Date | -- ||
1212
| maxDate | 指定日历最大日期范围,设置之后只能在该范围内滑动日历。 | Date | -- ||
1313
| format | 确认日期时,回调事件返回的日期格式。如“YY/MM/DD hh:mm” 、“YY 年 MM 月第 DD 天,当前时间 hh 时 mm 分”、“MM DD,YY at hh:mm F” | String | YY/MM/DD hh:mm ||

src/default-datetime/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# default-datetime
2+
3+
## 当前时间
4+
5+
### 代码演示
6+
7+
```html
8+
<vue-hash-calendar :default-datetime="new Date()" />
9+
```
10+
11+
## 2022/11/05
12+
13+
### 代码演示
14+
15+
```html
16+
<vue-hash-calendar :default-datetime="new Date(2022/11/05)" />
17+
```

src/default-datetime/demo/index.vue

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<h1 class="demo-title">当前时间</h1>
3+
<vue-hash-calendar :default-datetime="new Date()" />
4+
5+
<h1 class="demo-title">2022/11/05</h1>
6+
<vue-hash-calendar :default-datetime="new Date(2022 / 11 / 05)" />
7+
</template>
8+
9+
<script setup>
10+
import VueHashCalendar from '../../calendar';
11+
</script>
12+
13+
<style>
14+
.demo-title {
15+
margin: 24px;
16+
}
17+
</style>

0 commit comments

Comments
 (0)