s-menu-list.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!-- 装修基础组件:列表导航 -->
  2. <template>
  3. <view class="menu-list-wrap">
  4. <uni-list :border="true">
  5. <uni-list-item
  6. v-for="(item, index) in data.list"
  7. :key="index"
  8. showArrow
  9. clickable
  10. @tap="sheep.$router.go(item.url)"
  11. >
  12. <template v-slot:header>
  13. <view class="ss-flex ss-col-center">
  14. <image
  15. v-if="item.iconUrl"
  16. class="list-icon"
  17. :src="sheep.$url.cdn(item.iconUrl)"
  18. mode="aspectFit"
  19. ></image>
  20. <view
  21. class="title-text ss-flex ss-row-center ss-col-center ss-m-l-20"
  22. :style="[{ color: item.titleColor }]"
  23. >
  24. {{ item.title }}
  25. </view>
  26. </view>
  27. </template>
  28. <template v-slot:footer>
  29. <view
  30. class="notice-text ss-flex ss-row-center ss-col-center"
  31. :style="[{ color: item.subtitleColor }]"
  32. >
  33. {{ item.subtitle }}
  34. </view>
  35. </template>
  36. </uni-list-item>
  37. </uni-list>
  38. </view>
  39. </template>
  40. <script setup>
  41. /**
  42. * cell
  43. */
  44. import sheep from '@/sheep';
  45. const props = defineProps({
  46. data: {
  47. type: Object,
  48. default: () => ({}),
  49. },
  50. });
  51. </script>
  52. <style lang="scss">
  53. .list-icon {
  54. width: 20px;
  55. height: 20px;
  56. }
  57. .notice-text {
  58. }
  59. .menu-list-wrap {
  60. ::v-deep .uni-list {
  61. background-color: transparent;
  62. }
  63. }
  64. </style>