2024-11-08 10:05:27 +08:00

23 lines
521 B
Vue

<script setup lang="ts">
import { RouterView } from "vue-router";
import { useWindowStore } from "./store/window";
import { storeToRefs } from "pinia";
import { onMounted } from "vue";
const windowStore = useWindowStore();
const { innerWidth, innerHeight } = storeToRefs(windowStore);
onMounted(() => {
window.addEventListener("resize", () => {
innerWidth.value = window.innerWidth;
innerHeight.value = window.innerHeight;
});
});
</script>
<template>
<router-view />
</template>
<style scoped></style>