uni-tabbar.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <u-tabbar :value="value" @change="changeTabbar" :fixed="true" :border="false" :placeholder="true"
  3. activeColor="#F59A02" :safeAreaInsetBottom="true">
  4. <u-tabbar-item text="首页" name="home">
  5. <image class="u-page__item__slot-icon" slot="active-icon" src="../../static/images/nav_02.png"></image>
  6. <image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/images/nav_01.png">
  7. </image>
  8. </u-tabbar-item>
  9. <u-tabbar-item text="企业信息" name="firm">
  10. <image class="u-page__item__slot-icon" slot="active-icon" src="../../static/images/nav_04.png"></image>
  11. <image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/images/nav_03.png">
  12. </image>
  13. </u-tabbar-item>
  14. <u-tabbar-item text="我的" name="my">
  15. <image class="u-page__item__slot-icon" slot="active-icon" src="../../static/images/nav_06.png"></image>
  16. <image class="u-page__item__slot-icon" slot="inactive-icon" src="../../static/images/nav_05.png">
  17. </image>
  18. </u-tabbar-item>
  19. </u-tabbar>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. value: {
  25. type: String,
  26. default: "home",
  27. },
  28. },
  29. data() {
  30. return {
  31. }
  32. },
  33. methods: {
  34. changeTabbar(name){
  35. console.log(name,'name');
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. /deep/ .u-tabbar__content {
  42. background-image: url('@/static/images/nav_bg.png');
  43. background-size: 100% 100%;
  44. }
  45. /deep/ .u-tabbar-item {
  46. height: 70px;
  47. }
  48. /deep/ .u-tabbar__content[data-v-542a922e] {
  49. background-color: transparent;
  50. }
  51. /deep/ .u-tabbar__content {
  52. height: 60px;
  53. }
  54. .u-page__item__slot-icon {
  55. width: 32px;
  56. height: 32px;
  57. }
  58. /deep/ .u-tabbar-item__text {
  59. font-size: 11px;
  60. font-weight: 400;
  61. color: #4A5D94;
  62. }
  63. </style>