AppMain.vue 821 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <section class="app-main">
  3. <keep-alive>
  4. <router-view v-if="$route.meta.keepAlive" :key="key"/>
  5. </keep-alive>
  6. <router-view v-if="!$route.meta.keepAlive" :key="key"></router-view>
  7. </section>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'AppMain',
  12. // data() {
  13. // return {
  14. // pages:["Dashboard"]
  15. // }
  16. // },
  17. computed: {
  18. key() {
  19. return this.$route.path;
  20. },
  21. },
  22. };
  23. </script>
  24. <style scoped>
  25. .app-main {
  26. /*50 = navbar */
  27. min-height: calc(100vh - 50px);
  28. width: 100%;
  29. position: relative;
  30. /* overflow: hidden; */
  31. background: #f4f4f4;
  32. }
  33. .fixed-header + .app-main {
  34. padding-top: 50px;
  35. }
  36. </style>
  37. <style lang="scss">
  38. // fix css style bug in open el-dialog
  39. .el-popup-parent--hidden {
  40. .fixed-header {
  41. padding-right: 15px;
  42. }
  43. }
  44. </style>