s-menu-list.vue 1.4 KB

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