53 lines
1.4 KiB
Vue
53 lines
1.4 KiB
Vue
<template>
|
|
<template v-if="!isFullpage">
|
|
<div>
|
|
<HeadMenu @open-login-form="showLoginForm = true" @open-register-form="showRegisterForm = true" />
|
|
<div class="contain">
|
|
<router-view class="routerView" />
|
|
<Feedback/>
|
|
<Footer/>
|
|
</div>
|
|
</div>
|
|
<Login :isVisible="showLoginForm" @close-login-form="showLoginForm = false" />
|
|
<Register :isVisible="showRegisterForm" @close-register-form="showRegisterForm = false" />
|
|
</template>
|
|
<template v-else>
|
|
<router-view class="routerView" />
|
|
</template>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, watch, computed, onMounted } from 'vue';
|
|
import { useRoute } from 'vue-router';
|
|
|
|
import HeadMenu from '@/views/HeadMenu.vue';
|
|
|
|
import Footer from '@/views/Footer.vue';
|
|
import Login from '@/components/login.vue';
|
|
import Register from '@/components/register.vue';
|
|
import Feedback from './components/floatingMenu.vue';
|
|
|
|
const route = useRoute();
|
|
|
|
const showLoginForm = ref(false);
|
|
const showRegisterForm = ref(false); // 定义控制注册组件显示的变量
|
|
const fullpageRef = ref(true);
|
|
|
|
// 计算属性:根据当前路由的 meta 决定是否显示页头页脚
|
|
const isFullpage = computed(() => {
|
|
return route?.meta?.isFullpage || false;
|
|
});
|
|
|
|
fullpageRef.value = isFullpage.value
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.contain {
|
|
min-height: calc(100vh - 70px);
|
|
display: flex;
|
|
flex-direction: column;
|
|
.routerView {
|
|
flex: 1;
|
|
}
|
|
}
|
|
</style> |