<template>
  <router-view></router-view>
</template>

<script setup lang="ts">
import { onMounted, ref, provide, inject } from 'vue'
import { useStore } from '@/store/index'
const { setAsyncRoutesMark } = useStore()
window.addEventListener('beforeunload', () => beforeunloadFn())
const beforeunloadFn = (() => {
  setAsyncRoutesMark(false)
})

provide<GlobalPopup>('globalPopup', {
  showSuccess: (msg: string, time: number) => { console.log(msg, '执行成功', time) }, //!SECTION 成功
  showError: (msg: string, time: number) => { console.log(msg, '执行成功'), time }, //!SECTION 失败
  showWarning: (msg: string, time: number) => { console.log(msg, '执行成功'), time }, //!SECTION 警告
})



</script>

<style>
html,
body,
#app,
.layouts {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
</style>
