/**
 * ldesign v0.2.22
 * (c) 2022/12/7 16:21 built by swimly
 * @license MIT
 */

import { ref } from '@vue/composition-api';

function useHover(props) {
  const {
    disabled,
    readonly,
    onMouseenter,
    onMouseleave
  } = props;
  const isHover = ref(false);
  const addHover = context => {
    if (readonly || disabled) return;
    isHover.value = true;
    onMouseenter?.(context);
  };
  const cancelHover = context => {
    if (readonly || disabled) return;
    isHover.value = false;
    onMouseleave?.(context);
  };
  return {
    isHover,
    addHover,
    cancelHover
  };
}

export { useHover as default };
//# sourceMappingURL=use-hover.js.map
