MobileFooter.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. display:flex;
  37. text-align: center;
  38. justify-content:space-between;
  39. border-top:.02rem solid #ccc;
  40. background: #ffffff;
  41. z-index: 10;
  42. }
  43. .mobile-footer span{
  44. flex:1;
  45. font-size:.32rem;
  46. color:#b0b0b0;
  47. padding-top:.1rem;
  48. }
  49. .mobile-footer span a{
  50. color:#b0b0b0;
  51. }
  52. .mobile-footer span a i{
  53. font-size:.45rem;
  54. }
  55. .mobile-footer span a p{
  56. font-size:.22rem;
  57. }
  58. .mobile-footer span.active a{
  59. color:#3976f4;
  60. }
  61. </style>