import { defineComponent, ref, watchEffect, watch, openBlock, createBlock, unref, withCtx, renderSlot } from "vue";
import { List } from "vant";
const __default__ = {
  name: "WlLoadMore"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    modelValue: { type: Boolean, default: false },
    finished: { type: Boolean, default: false },
    finished_text: { default: "\u6CA1\u6709\u66F4\u591A\u4E86" }
  },
  emits: ["load", "update:modelValue"],
  setup(__props, { emit }) {
    const props = __props;
    const loadShow = ref(false);
    const onLoad = () => emit("load");
    watchEffect(() => {
      loadShow.value = props.modelValue;
    });
    watch(
      () => loadShow.value,
      (val) => {
        emit("update:modelValue", val);
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(List), {
        loading: loadShow.value,
        "onUpdate:loading": _cache[0] || (_cache[0] = ($event) => loadShow.value = $event),
        offset: 50,
        "immediate-check": false,
        finished: __props.finished,
        "finished-text": __props.finished_text,
        onLoad
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
      }, 8, ["loading", "finished", "finished-text"]);
    };
  }
});
_sfc_main.install = (Vue) => {
  Vue.component(_sfc_main.name, _sfc_main);
};
export { _sfc_main as default };
