<script setup lang="ts">
import { onMounted, onBeforeMount } from 'vue'
import { RouterView } from 'vue-router'
import useSystemStore from '@/stores/useSystemStore'

const systemStore = useSystemStore()
const { updateScreenWidth } = systemStore

onMounted(() => {
  window.addEventListener('resize', onWindowResize)
})

onBeforeMount(() => {
  window.removeEventListener('resize', onWindowResize)
})

function onWindowResize() {
  const clientWidth = document.documentElement.clientWidth
  updateScreenWidth(clientWidth)
}
onWindowResize()
</script>

<template>
  <div class="app_container">
    <RouterView />
  </div>
</template>

<style scoped>
</style>
