mirror of
https://github.com/youzan/vant.git
synced 2025-10-16 08:00:34 +00:00
feat(CountDown): time can be string type
This commit is contained in:
@@ -108,7 +108,7 @@ export default {
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| time | Total time | *number* | - |
|
||||
| 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` |
|
||||
|
@@ -118,7 +118,7 @@ export default {
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| time | 倒计时时长,单位毫秒 | *number* | - |
|
||||
| time | 倒计时时长,单位毫秒 | *number \| string* | `0` |
|
||||
| format | 时间格式 | *string* | `HH:mm:ss` |
|
||||
| auto-start | 是否自动开始倒计时 | *boolean* | `true` |
|
||||
| millisecond | 是否开启毫秒级渲染 | *boolean* | `false` |
|
||||
|
@@ -8,7 +8,7 @@ export default createComponent({
|
||||
props: {
|
||||
millisecond: Boolean,
|
||||
time: {
|
||||
type: Number,
|
||||
type: [Number, String],
|
||||
default: 0,
|
||||
},
|
||||
format: {
|
||||
@@ -84,7 +84,7 @@ export default createComponent({
|
||||
// @exposed-api
|
||||
reset() {
|
||||
this.pause();
|
||||
this.remain = this.time;
|
||||
this.remain = +this.time;
|
||||
|
||||
if (this.autoStart) {
|
||||
this.start();
|
||||
|
Reference in New Issue
Block a user