MobileFooter.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div class="mobile-footer">
  3. <span :class="activeType=='home'?'active':''">
  4. <nuxt-link to="/">
  5. <i :class="activeType=='home'?'iconfont icon-shouye':'iconfont icon-shouye1'"></i><p>首页</p>
  6. </nuxt-link>
  7. </span>
  8. <span :class="activeType=='shops'?'active':''">
  9. <nuxt-link to="/mobile/shop">
  10. <i :class="activeType=='shops'?'iconfont icon-dianpu':'iconfont icon-dianpu1'"></i><p>店铺</p>
  11. </nuxt-link>
  12. </span>
  13. <span :class="activeType=='user'?'active':''">
  14. <nuxt-link to="/mobile/user">
  15. <i :class="activeType=='user'?'iconfont icon-icon':'iconfont icon-wo'"></i><p>我</p>
  16. </nuxt-link>
  17. </span>
  18. </div>
  19. </template>
  20. <script>
  21. export default{
  22. name: 'MobileFooter',
  23. computed: {
  24. activeType () {
  25. return this.$route.path === '/' ? 'home' : this.$route.path === '/mobile/shop' ? 'shops' : this.$route.path === '/mobile/user' ? 'user' : ''
  26. }
  27. }
  28. }
  29. </script>
  30. <style scoped>
  31. .mobile-footer{
  32. position:fixed;
  33. bottom:0;
  34. width:100%;
  35. height:.98rem;
  36. text-align: center;
  37. border-top:.02rem solid #ccc;
  38. background: #ffffff;
  39. z-index: 10;
  40. }
  41. .mobile-footer span{
  42. display: inline-block;
  43. width: 2.5rem;
  44. font-size:.32rem;
  45. color:#b0b0b0;
  46. padding-top:.1rem;
  47. }
  48. .mobile-footer span a{
  49. color:#b0b0b0;
  50. }
  51. .mobile-footer span a i{
  52. font-size:.45rem;
  53. }
  54. .mobile-footer span a p{
  55. font-size:.22rem;
  56. }
  57. .mobile-footer span.active a{
  58. color:#3976f4;
  59. }
  60. </style>