Skip to content

Commit

Permalink
releases 4.3.16
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Dec 5, 2024
1 parent d73afbe commit 4e6a516
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vxe-pc-ui",
"version": "4.3.15",
"version": "4.3.16",
"description": "A vue based PC component library",
"scripts": {
"update": "npm install --legacy-peer-deps",
Expand Down
8 changes: 7 additions & 1 deletion packages/pulldown/src/pulldown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default defineComponent({
'update:modelValue',
'click',
'option-click',
'show-panel',
'hide-panel'
] as VxePulldownEmits,
setup (props, context) {
Expand Down Expand Up @@ -249,7 +250,10 @@ export default defineComponent({

const handleOptionEvent = (evnt: Event, option: VxePulldownPropTypes.Option) => {
if (!option.disabled) {
hidePanel()
if (reactData.visiblePanel) {
hidePanel()
dispatchEvent('hide-panel', {}, evnt)
}
dispatchEvent('option-click', { option }, evnt)
}
}
Expand All @@ -259,8 +263,10 @@ export default defineComponent({
if (trigger === 'click') {
if (reactData.visiblePanel) {
hidePanel()
dispatchEvent('hide-panel', {}, evnt)
} else {
showPanel()
dispatchEvent('show-panel', {}, evnt)
}
}
dispatchEvent('click', { $pulldown: $xePulldown }, evnt)
Expand Down
7 changes: 6 additions & 1 deletion types/components/pulldown.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export type VxePulldownEmits = [
'update:modelValue',
'click',
'option-click',
'show-panel',
'hide-panel'
]

Expand All @@ -130,26 +131,30 @@ export namespace VxePulldownDefines {
option: VxePulldownPropTypes.Option
}

export interface ShowPanelEventParams extends PulldownEventParams {}
export interface HidePanelEventParams extends PulldownEventParams {}
}

export type VxePulldownEventProps = {
onClick?: VxePulldownEvents.Click
onOptionClick?: VxePulldownEvents.OptionClick
onShowPanel?: VxePulldownEvents.ShowPanel
onHidePanel?: VxePulldownEvents.HidePanel
}

export interface VxePulldownListeners {
click?: VxePulldownEvents.Click
optionClick?: VxePulldownEvents.OptionClick
showPanel?: VxePulldownEvents.ShowPanel
hidePanel?: VxePulldownEvents.HidePanel
}

export namespace VxePulldownEvents {
export type Click = (params: VxePulldownDefines.ClickEventParams) => void
export type OptionClick = (params: VxePulldownDefines.OptionClickEventParams) => void
export type ShowPanel = (params: VxePulldownDefines.ShowPanelEventParams) => void
export type HidePanel = (params: VxePulldownDefines.HidePanelEventParams) => void
}
}

export namespace VxePulldownSlotTypes {
export interface DefaultSlotParams {
Expand Down

0 comments on commit 4e6a516

Please sign in to comment.