2020-09-27 22:27:25 +08:00
|
|
|
<template>
|
2021-06-05 12:05:41 +08:00
|
|
|
<n-layout :position="isMobile ? 'static' : 'absolute'" class="root-layout">
|
2021-01-12 23:05:51 +08:00
|
|
|
<site-header />
|
2021-05-26 14:39:33 +08:00
|
|
|
<router-view />
|
2020-09-27 22:27:25 +08:00
|
|
|
</n-layout>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-04-18 20:01:19 +08:00
|
|
|
import { onMounted } from 'vue'
|
|
|
|
import { useLoadingBar } from 'naive-ui'
|
2020-09-27 22:27:25 +08:00
|
|
|
import SiteHeader from './SiteHeader.vue'
|
|
|
|
import { loadingBarApiRef } from './routes/router'
|
2021-06-05 12:05:41 +08:00
|
|
|
import { useIsMobile } from './utils/composables'
|
2020-09-27 22:27:25 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'Site',
|
2020-11-03 15:10:29 +08:00
|
|
|
components: {
|
|
|
|
SiteHeader
|
|
|
|
},
|
2021-01-13 12:01:02 +08:00
|
|
|
setup () {
|
2021-04-18 20:01:19 +08:00
|
|
|
const loadingBar = useLoadingBar()
|
2021-06-05 12:05:41 +08:00
|
|
|
const isMobileRef = useIsMobile()
|
2021-01-13 12:01:02 +08:00
|
|
|
onMounted(() => {
|
|
|
|
loadingBarApiRef.value = loadingBar
|
|
|
|
loadingBar.finish()
|
|
|
|
})
|
2021-04-05 19:40:49 +08:00
|
|
|
return {
|
2021-06-05 12:05:41 +08:00
|
|
|
isMobile: isMobileRef
|
2021-04-05 19:40:49 +08:00
|
|
|
}
|
2020-09-27 22:27:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|