diff --git a/src/count-down/README.md b/src/count-down/README.md index 25efe539e..aad50c501 100644 --- a/src/count-down/README.md +++ b/src/count-down/README.md @@ -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` | diff --git a/src/count-down/README.zh-CN.md b/src/count-down/README.zh-CN.md index 8e52e2a64..d1ea48cb7 100644 --- a/src/count-down/README.zh-CN.md +++ b/src/count-down/README.zh-CN.md @@ -118,7 +118,7 @@ export default { | 参数 | 说明 | 类型 | 默认值 | |------|------|------|------| -| time | 倒计时时长,单位毫秒 | *number* | - | +| time | 倒计时时长,单位毫秒 | *number \| string* | `0` | | format | 时间格式 | *string* | `HH:mm:ss` | | auto-start | 是否自动开始倒计时 | *boolean* | `true` | | millisecond | 是否开启毫秒级渲染 | *boolean* | `false` | diff --git a/src/count-down/index.js b/src/count-down/index.js index 609952674..c13d36779 100644 --- a/src/count-down/index.js +++ b/src/count-down/index.js @@ -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();