import { computed, ref, watch } from "vue";
import { propsFactory } from "@veno-ui/utils";
const makeLazyProps = propsFactory({
  /**
   * @zh 急切的
   */
  eager: Boolean
}, "lazy");
function useLazy(props, active) {
  const isBooted = ref(false);
  const hasContent = computed(() => isBooted.value || props.eager || active.value);
  watch(active, () => isBooted.value = true);
  function onAfterLeave() {
    if (!props.eager)
      isBooted.value = false;
  }
  return { isBooted, hasContent, onAfterLeave };
}
export {
  makeLazyProps,
  useLazy
};
//# sourceMappingURL=index.mjs.map
