types(CountDown): add CountDownInstance type (#9153)

* types(CountDown): add CountDownInstance type

* chore: fix snapshot
This commit is contained in:
neverland
2021-07-29 15:34:08 +08:00
committed by GitHub
parent 8a0f7ff3f0
commit 44fb849a5f
6 changed files with 83 additions and 26 deletions
+13
View File
@@ -191,6 +191,19 @@ export default {
| pause | 暂停倒计时 | - | - |
| reset | 重设倒计时,若 `auto-start``true`,重设后会自动开始倒计时 | - | - |
### 类型定义
通过 `CountDownInstance` 获取 CountDown 实例的类型定义。
```ts
import { ref } from 'vue';
import type { CountDownInstance } from 'vant';
const countDownRef = ref<CountDownInstance>();
countDownRef.value?.start();
```
### 样式变量
组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/config-provider)。