AppMain.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <section class="app-main">
  3. <breadcrumb id="breadcrumb-container" class="breadcrumb-container" style="margin-left: 18px" />
  4. <transition name="fade-transform" mode="out-in">
  5. <keep-alive :include="cachedViews">
  6. <router-view :key="key" />
  7. </keep-alive>
  8. </transition>
  9. </section>
  10. </template>
  11. <script>
  12. import Breadcrumb from '@/components/Breadcrumb'
  13. export default {
  14. name: 'AppMain',
  15. components: {
  16. Breadcrumb
  17. },
  18. computed: {
  19. cachedViews() {
  20. return this.$store.state.tagsView.cachedViews
  21. },
  22. key() {
  23. return this.$route.path
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. .app-main {
  30. /* 50= navbar 50 */
  31. min-height: calc(100vh - 50px);
  32. width: 100%;
  33. position: relative;
  34. overflow: hidden;
  35. background-color: #fdfdfd;
  36. }
  37. .fixed-header+.app-main {
  38. padding-top: 50px;
  39. }
  40. .hasTagsView {
  41. .app-main {
  42. /* 84 = navbar + tags-view = 50 + 34 */
  43. min-height: calc(100vh);
  44. }
  45. .fixed-header+.app-main {
  46. padding-top: 84px;
  47. }
  48. }
  49. </style>
  50. <style lang="scss">
  51. // fix css style bug in open el-dialog
  52. .el-popup-parent--hidden {
  53. .fixed-header {
  54. padding-right: 15px;
  55. }
  56. }
  57. </style>