App.vue 996 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div id="app">
  3. <router-view></router-view>
  4. <div class="tab-bar" v-if="!$route.meta.hideTabBar">
  5. <TabBar></TabBar>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import TabBar from '@/components/TabBar.vue'
  11. export default {
  12. name: 'App',
  13. components: {
  14. TabBar
  15. },
  16. computed: {
  17. showTabBar() {
  18. const hideTabBarRoutes = ['/login', '/register', '/profile/detail']
  19. return !hideTabBarRoutes.includes(this.$route.path)
  20. }
  21. }
  22. }
  23. </script>
  24. <style>
  25. html {
  26. font-size: 16px;
  27. height: 100%;
  28. }
  29. body {
  30. margin: 0;
  31. padding: 0;
  32. font-size: 16px;
  33. -webkit-text-size-adjust: 100%;
  34. height: 100%;
  35. }
  36. h1{
  37. margin: 0;
  38. padding: 0;
  39. }
  40. #app {
  41. font-family: Arial, sans-serif;
  42. -webkit-font-smoothing: antialiased;
  43. -moz-osx-font-smoothing: grayscale;
  44. color: #2c3e50;
  45. height: 100%;
  46. /* padding-bottom: 50px; */
  47. min-height: 100vh;
  48. position: relative;
  49. }
  50. .tab-bar {
  51. position: fixed;
  52. bottom: 0;
  53. left: 0;
  54. width: 100%;
  55. z-index: 100;
  56. }
  57. </style>