fix(dropdown): fix click exception when using v-for (#735)

This commit is contained in:
XieZongChen 2021-07-30 09:59:44 -05:00 committed by GitHub
parent 6d73888865
commit 187e462297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -13,6 +13,10 @@
- `n-menu` add `render-extra` prop.
- `n-select` add `on-clear` prop.
### Fixes
- Fix `n-dropdown` click exception when using v-for.
## 2.15.11 (2021-07-29)
### Fixes

View File

@ -13,6 +13,10 @@
- `n-menu` 新增 `render-extra` 属性
- `n-select` 新增 `on-clear` 属性
### Fixes
- 修复 `n-dropdown` 循环渲染时点击异常
## 2.15.11 (2021-07-29)
### Fixes

View File

@ -10,7 +10,8 @@ import {
CSSProperties,
ComputedRef,
Ref,
toRef
toRef,
cloneVNode
} from 'vue'
import { VBinder, VTarget, FollowerPlacement } from 'vueuc'
import { useMergedState, useCompitable, useIsMounted, useMemo } from 'vooks'
@ -396,6 +397,7 @@ export default defineComponent({
triggerVNode = getFirstSlotVNode(slots, 'trigger')
}
if (triggerVNode) {
triggerVNode = cloneVNode(triggerVNode)
triggerVNode =
triggerVNode.type === textVNodeType
? h('span', [triggerVNode])