This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/src/components/layout/Container.vue
2022-11-07 15:25:00 +08:00

32 lines
850 B
Vue

<template>
<div class="cn-container" :style="entityDetectionStyle" :class="{'cn-container-entity': entityDetectionStyle}" id="cnContainer">
<router-view :key="routerKey"/>
</div>
</template>
<script>
import { listScrollPath } from '@/utils/constants'
export default {
name: 'Container',
data () {
return {
}
},
computed: {
routerKey () {
return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
},
entityDetectionStyle () {
const route = this.$route.name !== undefined ? this.$route.name : this.$route
if (listScrollPath.indexOf(route.path) > -1) {
const style = route.path === listScrollPath[0] ? 'overflow:auto;background-color: #EFF2F5;' : 'overflow:auto;'
return style
} else {
return ''
}
}
}
}
</script>