/**
 * ldesign v0.2.3
 * (c) 2022年9月24日 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 === null || onMouseenter === void 0 ? void 0 : onMouseenter(context);
  };

  const cancelHover = context => {
    if (readonly || disabled) return;
    isHover.value = false;
    onMouseleave === null || onMouseleave === void 0 ? void 0 : onMouseleave(context);
  };

  return {
    isHover,
    addHover,
    cancelHover
  };
}

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