<template>
 <b-div
  ref="fixedDiv"
  position="fixed"
 >
  <slot />
 </b-div>
</template>

<script setup>
import bDiv from "../../html-block/Div";
import { ref, onMounted } from "#imports";
const fixedDiv = ref();
onMounted(() => {
  const updateWidth = () => {
    if (fixedDiv.value && fixedDiv.value.$el.parentElement) {
      fixedDiv.value.$el.style.width = `${fixedDiv.value.$el.parentElement.offsetWidth}px`;
    }
  };
  window.addEventListener("resize", updateWidth);
  updateWidth();
});
</script>
