grid-sort-list.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="zaiui-grid-sort-view">
  3. <view class="bg-white cu-list grid col-5 no-border">
  4. <block v-for="(item,index) in list_data" :key="index" v-if="index < 10">
  5. <view class="cu-item" @tap="listTap(item,index)">
  6. <view class="grid-icon">
  7. <image :src="item.icon || '/static/zaiui/img/more.png'" mode="widthFix"/>
  8. </view>
  9. <text>{{item.name}}</text>
  10. </view>
  11. </block>
  12. <!-- <view class="cu-item" @tap="moreTap()">
  13. <view class="grid-icon">
  14. <image src="/static/zaiui/img/more.png" mode="widthFix"/>
  15. </view>
  16. <text>更多</text>
  17. </view> -->
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import _tool from '@/static/zaiui/util/tools.js';
  23. export default {
  24. name: 'grid-sort-list',
  25. props: {
  26. list_data: {
  27. type: Array,
  28. default: () => {
  29. return []
  30. }
  31. }
  32. },
  33. methods: {
  34. moreTap() {
  35. let index = this.list_data.length;
  36. this.listTap({type: 'more'},index);
  37. },
  38. listTap(data,index) {
  39. this.$emit('listTap', {
  40. data,
  41. index
  42. });
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss" scoped>
  48. .zaiui-grid-sort-view {
  49. .grid-icon {
  50. margin: 0 30upx;
  51. }
  52. }
  53. </style>