Files
dvcp_v2_webapp/src/components/mainContent.vue

41 lines
762 B
Vue
Raw Normal View History

2024-10-10 16:04:11 +08:00
<template>
<section class="mainContent">
<ai-nav-tab :fixed="$HomePage" :routes="routes"/>
2024-10-10 16:04:11 +08:00
<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}))
2024-10-10 16:04:11 +08:00
},
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>