Tabbar.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <footer class="tab-ctnr">
  3. <ul class="tab-box">
  4. <li v-for="(item,index) in items">
  5. <router-link :to="item.paths">
  6. <img v-if="$route.path == item.paths" :src="item.imgT">
  7. <img v-else :src="item.imgF">
  8. <p :class="{active:$route.path==item.paths}">{{item.name}}</p>
  9. </router-link>
  10. </li>
  11. </ul>
  12. </footer>
  13. </template>
  14. <script type="text/javascript">
  15. export default{
  16. data(){
  17. return {
  18. items:[
  19. {paths: '/home',name:'首页',
  20. imgT:require('../assets/img/首页-选中.png'),
  21. imgF:require('../assets/img/首页-未选.png')
  22. },
  23. {paths: '/contract',name:'合同',
  24. imgT:require('../assets/img/合同-选中.png'),
  25. imgF:require('../assets/img/合同-未选.png')
  26. },
  27. {paths: '/linkman',name:'联系人',
  28. imgT:require('../assets/img/联系人-选中.png'),
  29. imgF:require('../assets/img/联系人-未选.png')
  30. },
  31. {paths: '/mine',name:'我的',
  32. imgT:require('../assets/img/我-选中.png'),
  33. imgF:require('../assets/img/我-未选.png')
  34. },
  35. ]
  36. }
  37. }
  38. }
  39. </script>
  40. <style scoped>
  41. .tab-ctnr{
  42. width: 100%;
  43. position: fixed;
  44. bottom: 0;
  45. left: 0;
  46. background-color: #fff;
  47. .tab-box{
  48. height: 1.332623rem;
  49. display: flex;
  50. justify-content: space-around;
  51. font-family: FZLTHJW--GB1-0;
  52. font-size: 0;
  53. p{
  54. color: #a2a2a2;
  55. font-size: 22px;/*px*/
  56. }
  57. p.active{
  58. color: #60c0ff;
  59. }
  60. img{
  61. width: 0.861111rem;
  62. height: 0.861111rem;
  63. }
  64. }
  65. }
  66. </style>