App.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div id="app">
  3. <router-view class="main" />
  4. <Tabbar v-show="isshowNav" route v-model="active">
  5. <TabbarItem :to="{ name: 'index' }" icon="home-o">首页</TabbarItem>
  6. <TabbarItem :to="{ name: 'myindex' }" icon="friends-o">我的</TabbarItem>
  7. </Tabbar>
  8. </div>
  9. </template>
  10. <script>
  11. import { Tabbar, TabbarItem } from 'vant';
  12. export default {
  13. data () {
  14. return {
  15. active: 0,
  16. }
  17. },
  18. computed: {
  19. isshowNav () {
  20. return this.$route.meta.hideNav
  21. }
  22. },
  23. components: {
  24. Tabbar, TabbarItem
  25. },
  26. methods: {
  27. },
  28. }
  29. </script>
  30. <style lang="scss">
  31. // @import url(@/assets/icon/iconfont.css;);
  32. * {
  33. margin: 0;
  34. padding: 0;
  35. }
  36. html {
  37. width: 100vw;
  38. height: 100vh;
  39. // font-size: 10px; // 相当于1rem = 10px
  40. position: relative;
  41. }
  42. body {
  43. width: 100vw;
  44. height: 100vh;
  45. // font-size: 10px;
  46. position: relative;
  47. }
  48. #app {
  49. display: flex;
  50. width: 100vw;
  51. flex-direction: column;
  52. }
  53. #app .main {
  54. flex: 1;
  55. overflow: auto;
  56. padding-bottom: 7vh;
  57. }
  58. .van-tabbar {
  59. height: 7vh !important;
  60. }
  61. .van-tabbar-item .van-icon {
  62. font-size: 1rem;
  63. }
  64. .van-tabbar-item .van-toast__text {
  65. font-size: 18px;
  66. }
  67. </style>