sh-grid.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view class="grid-wap u-m-b-10 u-flex u-flex-wrap u-col-center" v-if="list.length">
  3. <view class="grid-item u-flex-col u-row-center u-col-center" v-for="(menu, index) in list" :key="index" @tap="jump(menu)">
  4. <image class="tool-img" :src="menu.image" mode="aspectFill"></image>
  5. <view class="item-title">{{ menu.name }}</view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. /**
  11. * shGrid-宫格列表
  12. * @property {Array} list - 宫格列表
  13. */
  14. export default {
  15. components: {},
  16. data() {
  17. return {};
  18. },
  19. computed: {},
  20. props: {
  21. list: {
  22. type: Array,
  23. default: () => {
  24. return [];
  25. }
  26. }
  27. },
  28. created() {},
  29. methods: {
  30. jump(data) {
  31. this.$tools.routerTo(data.path);
  32. }
  33. }
  34. };
  35. </script>
  36. <style lang="scss">
  37. // 宫格
  38. .grid-wap {
  39. background: #fff;
  40. width: 750rpx;
  41. padding: 30rpx 0 0;
  42. .grid-item {
  43. width: 25%;
  44. margin-bottom: 40rpx;
  45. .tool-img {
  46. width: 44rpx;
  47. height: 44rpx;
  48. }
  49. .item-title {
  50. font-size: 26rpx;
  51. font-weight: 500;
  52. color: rgba(153, 153, 153, 1);
  53. line-height: 24rpx;
  54. padding-top: 20rpx;
  55. }
  56. }
  57. }
  58. </style>