App.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class="app">
  3. <main-header></main-header>
  4. <home-body v-if="home.visible"></home-body>
  5. <station-body v-if="station.visible"></station-body>
  6. <main-footer></main-footer>
  7. </div>
  8. </template>
  9. <script>
  10. import MainHeader from './MainHeader.vue'
  11. import HomeBody from './HomeBody.vue'
  12. import StationBody from './StationBody.vue'
  13. import MainFooter from './MainFooter.vue'
  14. export default {
  15. data() {
  16. return {
  17. home: {
  18. visible: true
  19. },
  20. station: {
  21. visible: false
  22. }
  23. }
  24. },
  25. methods: {
  26. goHome() {
  27. this.home.visible = true;
  28. for (let i = 0; i < this.length; i++) {
  29. this[i].visible = false;
  30. }
  31. }
  32. },
  33. components: { MainHeader, HomeBody, StationBody, MainFooter },
  34. events: {
  35. 'switchView': (hide, show) => {
  36. this[hide].visible = false;
  37. this[show].visible = true;
  38. }
  39. }
  40. }
  41. </script>
  42. <style lang="sass">
  43. * { box-sizing: border-box; font-family: Roboto, sans-serif; }
  44. html {
  45. width: 100%;
  46. height: 100%;
  47. color: rgba(0, 0, 0, 0.87);
  48. body {
  49. width: 100%;
  50. height: 100%;
  51. margin: 0;
  52. padding: 0;
  53. }
  54. }
  55. @media only screen and (min-width: 1200px) {
  56. html {
  57. font-size: 15px;
  58. }
  59. }
  60. @media only screen and (min-width: 992px) {
  61. html {
  62. font-size: 14.5px;
  63. }
  64. }
  65. @media only screen and (min-width: 0) {
  66. html {
  67. font-size: 14px;
  68. }
  69. }
  70. </style>