/**
 * ldesign v0.2.2
 * (c) 2022年9月20日 swimly
 * @license MIT
 */

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

function useHover(props) {
  var disabled = props.disabled,
      readonly = props.readonly,
      onMouseenter = props.onMouseenter,
      onMouseleave = props.onMouseleave;
  var isHover = ref(false);

  var addHover = function addHover(context) {
    if (readonly || disabled) return;
    isHover.value = true;
    onMouseenter === null || onMouseenter === void 0 ? void 0 : onMouseenter(context);
  };

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

  return {
    isHover: isHover,
    addHover: addHover,
    cancelHover: cancelHover
  };
}

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