mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-14 09:20:51 +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)
|
|
}
|
|
},
|
|
}
|
|
}
|