feat(@vant/use): useClickAway support multiple targets (#10948)

This commit is contained in:
neverland
2022-08-21 10:55:18 +08:00
committed by GitHub
parent 1e8187bc37
commit 31ac5faa3a
3 changed files with 17 additions and 9 deletions
@@ -74,7 +74,7 @@ function useClickAway(
| Name | Description | Type | Default Value |
| --- | --- | --- | --- |
| target | Target element | _Element \| Ref\<Element>_ | - |
| target | Target element, support multiple elements | _Element \| Ref\<Element> \| Array\<Element \| Ref\<Element>>_ | - |
| listener | Callback function when the outside is clicked | _EventListener_ | - |
| options | Options | _Options_ | `{ eventName: 'click' }` |
@@ -74,11 +74,11 @@ function useClickAway(
### 参数
| 参数 | 说明 | 类型 | 默认值 |
| -------- | ------------------------ | -------------------------- | ------ |
| target | 绑定事件的元素 | _Element \| Ref\<Element>_ | - |
| listener | 点击外部时触发的回调函数 | _EventListener_ | - |
| options | 可选的配置项 | _Options_ | 见下表 |
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| target | 绑定事件的元素,支持传入数组来绑定多个元素 | _Element \| Ref\<Element> \| Array\<Element \| Ref\<Element>>_ | - |
| listener | 点击外部时触发的回调函数 | _EventListener_ | - |
| options | 可选的配置项 | _Options_ | 见下表 |
### Options