123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <div class="parent" @click="layoutClick">
- <NavBar class="headers"></NavBar>
- <div class="content">
- <router-view :key="router.currentRoute.value.path + Math.random()"></router-view>
- <!-- <router-view v-slot="{ Component }">
- <keep-alive>
- <component :is="Component" :key="router.currentRoute.value.path" v-if="router.currentRoute.value.meta?.keepAlive"/>
- </keep-alive>
- <component :is="Component" :key="router.currentRoute.value.path" v-if="!router.currentRoute.value.meta?.keepAlive"/>
- </router-view> -->
- </div>
- <Footers v-if="footerWhiteList.indexOf(router.currentRoute.value.path) === -1" :class="{'mt-10': !router.currentRoute.value.path.includes('/mall')}"></Footers>
- <Slider v-if="whiteList.indexOf(router.currentRoute.value.path) === -1" class="slider"></Slider>
- <BackTop />
- </div>
- </template>
- <script setup>
- defineOptions({ name: 'personal-layout-index' })
- import { onMounted, watch } from 'vue'
- import NavBar from './personal/navBar.vue'
- import Footers from './personal/footer.vue'
- import Slider from './personal/slider.vue'
- import { useSharedState } from '@/store/sharedState'
- import { useRouter } from 'vue-router'
- import { useMallStore } from '@/store/mall'
- import BackTop from '@/components/BackTop'
- // 不展示侧边栏名单
- const whiteList = ['/login', '/privacyPolicy', '/userAgreement', '/register', '/recruit/personal/advertisement/introduce', '/contactService']
- // 不展示页脚白名单
- const footerWhiteList = [
- '/recruit/personal/message',
- '/recruit/personal/advertisement/introduce',
- '/headhunting',
- '/headhunting/service',
- '/headhunting/service/details',
- '/recruit/personal/resume/analysis',
- '/contactService'
- ]
- const router = useRouter()
- const sharedState = useSharedState()
- const layoutClick = () => {
- sharedState.increment()
- }
- onMounted(async () => {
- await useMallStore().getMallDiyTemplate()
- })
- </script>
- <style lang="scss" scoped>
- .parent {
- background-color: var(--default-bgc);
- position: relative;
- }
- .headers {
- position: fixed;
- right: 0;
- left: 0;
- top: 0;
- z-index: 999;
- }
- .slider {
- position: fixed;
- bottom: 50%;
- right: 24px;
- translate: 0 50%;
- z-index: 999;
- }
- .content {
- min-height: calc(100vh - 242px);
- margin-top: 50px;
- }
- </style>
|