Tabbar.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <view>
  3. <u-tabbar :list="tabbarList"
  4. mid-button-size="112" :mid-button="true"
  5. @input="gotoinput"
  6. inactive-color="#ADB8C2" active-color="#5098FF">
  7. </u-tabbar>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. name: "Tabbar",
  13. props: {
  14. },
  15. data() {
  16. return {
  17. tabbarList: [{
  18. iconPath:require("@/assets/img/tabBar/index1.png") ,
  19. selectedIconPath: require( "@/assets/img/tabBar/index1-HL.png"),
  20. text: '附近 ',
  21. pagePath: "/pages/index/index",
  22. },
  23. {
  24. iconPath: require("@/assets/img/tabBar/parking_icon.png"),
  25. selectedIconPath: require("@/assets/img/tabBar/parking_icon.png"),
  26. text: '',
  27. pagePath2: "/pages/index/lockInfo",
  28. midButton: true,
  29. },
  30. {
  31. iconPath: require("@/assets/img/tabBar/center.png"),
  32. selectedIconPath: require("@/assets/img/tabBar/center-HL.png"),
  33. text: '我的',
  34. pagePath: "/pages/index/center",
  35. }
  36. ],
  37. };
  38. },
  39. methods: {
  40. gotoinput(i){
  41. var item=this.tabbarList[i]
  42. if(!item.pagePath){
  43. uni.reLaunch({
  44. url:item.pagePath2
  45. })
  46. }
  47. }
  48. },
  49. mounted() {
  50. },
  51. destroyed() {
  52. }
  53. }
  54. </script>
  55. <style>
  56. </style>