summaryrefslogtreecommitdiff
path: root/src/components/layout/Container.vue
blob: d7ce754527648565c3768244860b0e8a49cc26d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<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) {
        return 'overflow:auto;'
      } else {
        return ''
      }
    }
  }
}
</script>