docs: prettier all markdown files

This commit is contained in:
chenjiahan
2020-04-11 09:17:33 +08:00
committed by neverland
parent 48067f79db
commit 7f84f8a487
140 changed files with 4441 additions and 4723 deletions
+48 -48
View File
@@ -21,10 +21,10 @@ Vue.use(CountDown);
export default {
data() {
return {
time: 30 * 60 * 60 * 1000
time: 30 * 60 * 60 * 1000,
};
}
}
},
};
```
### Custom Format
@@ -51,15 +51,15 @@ export default {
</van-count-down>
<style>
.item {
display: inline-block;
width: 22px;
margin-right: 5px;
color: #fff;
font-size: 12px;
text-align: center;
background-color: #1989fa;
}
.item {
display: inline-block;
width: 22px;
margin-right: 5px;
color: #fff;
font-size: 12px;
text-align: center;
background-color: #1989fa;
}
</style>
```
@@ -97,9 +97,9 @@ export default {
},
finish() {
Toast('Finished');
}
}
}
},
},
};
```
## API
@@ -107,53 +107,53 @@ export default {
### Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| time | Total time | *number \| string* | `0` |
| format | Time format | *string* | `HH:mm:ss` |
| auto-start | Whether to auto start count down | *boolean* | `true` |
| millisecond | Whether to enable millisecond render | *boolean* | `false` |
| --- | --- | --- | --- |
| time | Total time | _number \| string_ | `0` |
| format | Time format | _string_ | `HH:mm:ss` |
| auto-start | Whether to auto start count down | _boolean_ | `true` |
| millisecond | Whether to enable millisecond render | _boolean_ | `false` |
### Available formats
| Format | Description |
|------|------|
| DD | Day |
| HH | Hour |
| mm | Minute |
| ss | Second |
| S | Millisecond, 1-digit |
| SS | Millisecond, 2-digits |
| SSS | Millisecond, 3-digits |
| Format | Description |
| ------ | --------------------- |
| DD | Day |
| HH | Hour |
| mm | Minute |
| ss | Second |
| S | Millisecond, 1-digit |
| SS | Millisecond, 2-digits |
| SSS | Millisecond, 3-digits |
### Events
| Event | Description | Arguments |
|------|------|------|
| finish | Triggered when count down finished | - |
| change `v2.4.4` | Triggered when count down changed | *timeData: TimeData* |
| Event | Description | Arguments |
| --------------- | ---------------------------------- | -------------------- |
| finish | Triggered when count down finished | - |
| change `v2.4.4` | Triggered when count down changed | _timeData: TimeData_ |
### Slots
| Name | Description | SlotProps |
|------|------|------|
| default | Custom Content | *timeData: TimeData* |
| Name | Description | SlotProps |
| ------- | -------------- | -------------------- |
| default | Custom Content | _timeData: TimeData_ |
### TimeData Structure
| Name | Description | Type |
|------|------|------|
| days | Remain days | *number* |
| hours | Remain hours | *number* |
| minutes | Remain minutes | *number* |
| seconds | Remain seconds | *number* |
| milliseconds | Remain milliseconds | *number* |
| Name | Description | Type |
| ------------ | ------------------- | -------- |
| days | Remain days | _number_ |
| hours | Remain hours | _number_ |
| minutes | Remain minutes | _number_ |
| seconds | Remain seconds | _number_ |
| milliseconds | Remain milliseconds | _number_ |
### Methods
Use [ref](https://vuejs.org/v2/api/#ref) to get CountDown instance and call instance methods
| Name | Description | Attribute | Return value |
|------|------|------|------|
| start | Start count down | - | - |
| pause | Pause count down | - | - |
| reset | Reset count down | - | - |
| Name | Description | Attribute | Return value |
| ----- | ---------------- | --------- | ------------ |
| start | Start count down | - | - |
| pause | Pause count down | - | - |
| reset | Reset count down | - | - |
+45 -45
View File
@@ -23,10 +23,10 @@ Vue.use(CountDown);
export default {
data() {
return {
time: 30 * 60 * 60 * 1000
time: 30 * 60 * 60 * 1000,
};
}
}
},
};
```
### 自定义格式
@@ -59,15 +59,15 @@ export default {
</van-count-down>
<style>
.item {
display: inline-block;
width: 22px;
margin-right: 5px;
color: #fff;
font-size: 12px;
text-align: center;
background-color: #1989fa;
}
.item {
display: inline-block;
width: 22px;
margin-right: 5px;
color: #fff;
font-size: 12px;
text-align: center;
background-color: #1989fa;
}
</style>
```
@@ -107,63 +107,63 @@ export default {
},
finish() {
Toast('倒计时结束');
}
}
}
},
},
};
```
## API
### Props
| 参数 | 说明 | 类型 | 默认值 |
|------|------|------|------|
| time | 倒计时时长,单位毫秒 | *number \| string* | `0` |
| format | 时间格式 | *string* | `HH:mm:ss` |
| auto-start | 是否自动开始倒计时 | *boolean* | `true` |
| millisecond | 是否开启毫秒级渲染 | *boolean* | `false` |
| 参数 | 说明 | 类型 | 默认值 |
| ----------- | -------------------- | ------------------ | ---------- |
| time | 倒计时时长,单位毫秒 | _number \| string_ | `0` |
| format | 时间格式 | _string_ | `HH:mm:ss` |
| auto-start | 是否自动开始倒计时 | _boolean_ | `true` |
| millisecond | 是否开启毫秒级渲染 | _boolean_ | `false` |
### format 格式
| 格式 | 说明 |
|------|------|
| DD | 天数 |
| HH | 小时 |
| mm | 分钟 |
| ss | 秒数 |
| S | 毫秒(1 位) |
| SS | 毫秒(2 位) |
| SSS | 毫秒(3 位) |
| 格式 | 说明 |
| ---- | ------------ |
| DD | 天数 |
| HH | 小时 |
| mm | 分钟 |
| ss | 秒数 |
| S | 毫秒(1 位) |
| SS | 毫秒(2 位) |
| SSS | 毫秒(3 位) |
### Events
| 事件名 | 说明 | 回调参数 |
|------|------|------|
| finish | 倒计时结束时触发 | - |
| change `v2.4.4` | 倒计时变化时触发 | *timeData: TimeData* |
| 事件名 | 说明 | 回调参数 |
| --------------- | ---------------- | -------------------- |
| finish | 倒计时结束时触发 | - |
| change `v2.4.4` | 倒计时变化时触发 | _timeData: TimeData_ |
### Slots
| 名称 | 说明 | SlotProps |
|------|------|------|
| default | 自定义内容 | *timeData: TimeData* |
| 名称 | 说明 | SlotProps |
| ------- | ---------- | -------------------- |
| default | 自定义内容 | _timeData: TimeData_ |
### TimeData 格式
| 名称 | 说明 | 类型 |
|------|------|------|
| days | 剩余天数 | *number* |
| hours | 剩余小时 | *number* |
| minutes | 剩余分钟 | *number* |
| seconds | 剩余秒数 | *number* |
| milliseconds | 剩余毫秒 | *number* |
| 名称 | 说明 | 类型 |
| ------------ | -------- | -------- |
| days | 剩余天数 | _number_ |
| hours | 剩余小时 | _number_ |
| minutes | 剩余分钟 | _number_ |
| seconds | 剩余秒数 | _number_ |
| milliseconds | 剩余毫秒 | _number_ |
### 方法
通过 ref 可以获取到 CountDown 实例并调用实例方法,详见[组件实例方法](#/zh-CN/quickstart#zu-jian-shi-li-fang-fa)
| 方法名 | 说明 | 参数 | 返回值 |
|------|------|------|------|
| --- | --- | --- | --- |
| start | 开始倒计时 | - | - |
| pause | 暂停倒计时 | - | - |
| reset | 重设倒计时,若`auto-start``true`,重设后会自动开始倒计时 | - | - |