types(Picker): add PickerInstance type (#9183)

This commit is contained in:
neverland
2021-08-04 17:41:36 +08:00
committed by GitHub
parent d36b4a901d
commit 5b525def3a
6 changed files with 98 additions and 44 deletions
+13
View File
@@ -407,6 +407,19 @@ export default {
| setColumnValues | 设置对应列中所有选项 | columnIndex, values | - |
| confirm | 停止惯性滚动并触发 confirm 事件 | - | - |
### 类型定义
通过 `PickerInstance` 获取 Picker 实例的类型定义。
```ts
import { ref } from 'vue';
import type { PickerInstance } from 'vant';
const pickerRef = ref<PickerInstance>();
pickerRef.value?.confirm();
```
### 样式变量
组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](#/zh-CN/config-provider)。