AppMain.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <section class="app-main">
  3. <transition
  4. name="fade-transform"
  5. mode="out-in"
  6. >
  7. <keep-alive>
  8. <router-view :key="key" />
  9. </keep-alive>
  10. </transition>
  11. <message-drawer ref="nav-usermessage" />
  12. </section>
  13. </template>
  14. <script>
  15. import MessageDrawer from './Message'
  16. export default {
  17. name: 'AppMain',
  18. components: {
  19. MessageDrawer
  20. },
  21. computed: {
  22. key() {
  23. return this.$route.path
  24. }
  25. },
  26. methods: {
  27. showMessage() {
  28. this.$nextTick(() => {
  29. this.$refs['nav-usermessage'].init()
  30. })
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. $navHeight:75px;
  37. .app-main {
  38. /* 50= navbar 50 */
  39. min-height: calc(100vh - 75px);
  40. width: 100%;
  41. position: relative;
  42. overflow: hidden;
  43. background-color: #071A29;
  44. }
  45. .fixed-header+.app-main {
  46. padding-top: 50px;
  47. }
  48. .hasTagsView {
  49. .app-main {
  50. /* 84 = navbar + tags-view = 50 + 34 */
  51. min-height: calc(100vh - 84px);
  52. }
  53. .fixed-header+.app-main {
  54. padding-top: 84px;
  55. }
  56. }
  57. </style>
  58. <style lang="scss">
  59. // fix css style bug in open el-dialog
  60. .el-popup-parent--hidden {
  61. .fixed-header {
  62. padding-right: 15px;
  63. }
  64. }
  65. </style>