bottomTab.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div id="bottomTab">
  3. <mu-container style="width: 100%;" color="primary">
  4. <mu-bottom-nav :value="nowTab" color="#E75296">
  5. <mu-bottom-nav-item v-for="tab in tabs" :title="tab.name" :icon="tab.src" :to="tab.class" :key="tab.tabindex"
  6. :value="tab.name"></mu-bottom-nav-item>
  7. </mu-bottom-nav>
  8. </mu-container>
  9. </div>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. nowTab: this.curTab,
  16. tabs: [
  17. {name: '预约课程', class: '/', src: ' ', tabindex: 1},
  18. {name: '预约记录', class: 'record', src: ' ', tabindex: 2},
  19. {name: '我的', class: 'mine', src: ' ', tabindex: 3},
  20. //laptop
  21. ]
  22. }
  23. },
  24. props: ['curTab'],
  25. methods: {},
  26. watch: {
  27. '$route': function (e) {
  28. this.nowTab = e.meta.title;
  29. }
  30. },
  31. }
  32. </script>
  33. <style scoped>
  34. #bottomTab {
  35. position: absolute;
  36. bottom: 0;
  37. width: 100%;
  38. background: #fff;
  39. border-top: 1px solid #eee;
  40. z-index: 9999;
  41. }
  42. .container {
  43. padding: 0;
  44. }
  45. /*非选中态图标 */
  46. /deep/ a:nth-child(1) .mu-bottom-item-icon {
  47. background-image: url(../static/images/bottom/Calendar@2x.png);
  48. background-repeat: no-repeat;
  49. width: 24px;
  50. height: 24px;
  51. background-size: auto 24px;
  52. }
  53. /deep/ a:nth-child(2) .mu-bottom-item-icon {
  54. background-image: url(../static/images/bottom/Newspaper@2x.png);
  55. background-repeat: no-repeat;
  56. width: 24px;
  57. height: 24px;
  58. background-size: auto 24px;
  59. }
  60. /deep/ a:nth-child(3) .mu-bottom-item-icon {
  61. background-image: url(../static/images/bottom/User@2x.png);
  62. background-repeat: no-repeat;
  63. width: 24px;
  64. height: 24px;
  65. background-size: auto 24px;
  66. }
  67. /*选中态图标*/
  68. /deep/ a:nth-child(1).mu-bottom-item-active .mu-bottom-item-icon {
  69. background-image: url(../static/images/bottom/CalendarRed@2x.png);
  70. background-repeat: no-repeat;
  71. width: 24px;
  72. height: 24px;
  73. background-size: auto 24px;
  74. }
  75. /deep/ a:nth-child(2).mu-bottom-item-active .mu-bottom-item-icon {
  76. background-image: url(../static/images/bottom/NewspaperRed@2x.png);
  77. background-repeat: no-repeat;
  78. width: 24px;
  79. height: 24px;
  80. background-size: auto 24px;
  81. }
  82. /deep/ a:nth-child(3).mu-bottom-item-active .mu-bottom-item-icon {
  83. background-image: url(../static/images/bottom/UserRed@2x.png);
  84. background-repeat: no-repeat;
  85. width: 24px;
  86. height: 24px;
  87. background-size: auto 24px;
  88. }
  89. .mu-bottom-item-text {
  90. color: #999999
  91. }
  92. .mu-bottom-item-active .mu-bottom-item-text {
  93. color: #2b2b2b;
  94. }
  95. </style>