Files
dvcp_v2_webapp/src/components/mainContent.vue
aixianling b7c0350134 feat(config): 添加自定义首页配置并优化导航功能
-增加自定义首页配置项,支持设置不同的首页组件
-优化导航功能,添加固定首页到导航栏
- 重构路由生成逻辑,支持自定义签到页和首页
- 更新组件以适应新的导航结构
2024-12-23 14:19:00 +08:00

41 lines
762 B
Vue

<template>
<section class="mainContent">
<ai-nav-tab :fixed="$HomePage" :routes="routes"/>
<router-view v-if="refresh"/>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "mainContent",
computed: {
...mapState(['user']),
routes: v => v.user.info?.menuSet?.map(e => ({...e, label: e.name, name: e.component}))
},
watch: {
$route(v, old) {
if (v.meta == old.meta && v.fullPath != old.fullPath) {
this.refresh = false
this.$nextTick(() => this.refresh = true)
}
}
},
data() {
return {
refresh: true
}
}
}
</script>
<style lang="scss" scoped>
.mainContent {
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
}
</style>