mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
17 lines
346 B
TypeScript
17 lines
346 B
TypeScript
import type { IOptionProps } from './token'
|
|
|
|
export function useOption(props: IOptionProps, { emit }) {
|
|
return {
|
|
hoverItem: () => {
|
|
if (!props.disabled) {
|
|
emit('hover', props.index)
|
|
}
|
|
},
|
|
selectOptionClick: () => {
|
|
if (!props.disabled) {
|
|
emit('select', props.item, props.index)
|
|
}
|
|
},
|
|
}
|
|
}
|