Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

fix(dropdown):修复 dropdown 下拉后箭头旋转向上 #20

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ export const hide = ({ api, props, state }) => () => {
)
}

export const handleClick = ({ api, props, state }) => () => {
export const handleClick = ({ api, props, state,emit }) => () => {
if (props.disabled) {
return
}

emit('handle-click',state.visible)

state.visible ? api.hide() : api.show()
}

Expand Down
2 changes: 1 addition & 1 deletion src/dropdown/vue.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const renderless = (props, { reactive, watch, provide, onMounted }, { emi
show: show({ props, state }),
hide: hide({ api, props, state }),
mounted: mounted({ api, vm }),
handleClick: handleClick({ api, props, state }),
handleClick: handleClick({ api, props, state,emit }),
handleTriggerKeyDown: handleTriggerKeyDown({ api, state }),
handleItemKeyDown: handleItemKeyDown({ api, props, state }),
resetTabindex: resetTabindex({ api }),
Expand Down