navigationTab.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template name="navigation">
  2. <!-- 自定义分类导航栏 -->
  3. <view class="tabbar clearfix">
  4. <view class="cate-item" v-for="(nav,idx) in tabList" :key="idx" @click.stop="navToListPage(nav)">
  5. <image class="tui-skeleton-fillet" :src="nav.classifyImage"></image>
  6. <text class="tui-skeleton-rect">{{nav.classifyName}}</text>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. var self;
  12. export default{
  13. name:'navigation',
  14. props:{
  15. tabList: { // 由父页面传递的数据
  16. type: Array,
  17. value: [],
  18. },
  19. },
  20. data() {
  21. return{
  22. }
  23. },
  24. created() {
  25. },
  26. onLoad(){
  27. },
  28. methods:{
  29. navToListPage(nav){
  30. this.$api.navToListPage({type:'0',value:nav.classifyName,id:nav.id});
  31. }
  32. },
  33. onShow(){
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. .tabbar{
  39. margin-bottom: 26rpx;
  40. }
  41. .cate-item {
  42. width: 118rpx;
  43. margin-right:28rpx;
  44. display: flex;
  45. float: left;
  46. flex-direction: column;
  47. align-items: center;
  48. font-size: $font-size-26;
  49. color: $text-color;
  50. line-height: 36rpx;
  51. &:last-child{
  52. margin-right: 0;
  53. }
  54. &:nth-child(5n){
  55. margin-right: 0;
  56. }
  57. image {
  58. width: 90rpx;
  59. height: 90rpx;
  60. margin-bottom: 8rpx;
  61. border-radius: 50%;
  62. }
  63. }
  64. </style>