import { defineComponent, ref, onActivated, openBlock, createElementBlock, renderSlot } from "vue";
import { onBeforeRouteLeave } from "vue-router";
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
var _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const __default__ = {
  name: "BCRecordScroll"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  setup(__props) {
    const scroll_distance = ref(0);
    const scroll_elem = ref(null);
    onBeforeRouteLeave(() => {
      scroll_distance.value = scroll_elem.value.scrollTop;
    });
    onActivated(() => {
      scroll_elem.value.scrollTop = scroll_distance.value;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "srcoll",
        ref_key: "scroll_elem",
        ref: scroll_elem
      }, [
        renderSlot(_ctx.$slots, "default", {}, void 0, true)
      ], 512);
    };
  }
});
var Comp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2ad1fb2c"]]);
var __uno = "";
Comp.install = (app) => {
  app.component(Comp.name, Comp);
};
export { Comp as default };
