catalogue.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view>
  3. <view>
  4. <uni-icons type="left" size="30" @click="handleBack"></uni-icons>
  5. </view>
  6. <view>
  7. <uni-collapse ref="collapse" v-model="value">
  8. <uni-collapse-item :title="item.label" v-for="(item,index) in list" class="parent-item">
  9. <template v-slot:title>
  10. <uni-list>
  11. <view class="title-layout">
  12. <view>
  13. <uni-badge class="uni-badge-left-margin" :text="index+1" type="primary" />
  14. <text>{{item.label}}</text>
  15. </view>
  16. <uni-icons type="locked-filled" size="16" style="justify-self: flex-end;"></uni-icons>
  17. </view>
  18. </uni-list>
  19. </template>
  20. <view class="content">
  21. <view class="text child-item" v-for="(citem,cIndex) in item.children">{{index+1}}.{{cIndex+1}}
  22. {{citem.label}}</view>
  23. </view>
  24. </uni-collapse-item>
  25. </uni-collapse>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. import {
  31. ref
  32. } from "vue";
  33. const activeCollapse = ref('');
  34. const list = [{
  35. label: '时、分、秒',
  36. lock: false,
  37. children: [],
  38. },
  39. {
  40. label: '测量',
  41. lock: false,
  42. children: [{
  43. label: '长度中的隐含条件',
  44. index: 1,
  45. },
  46. {
  47. label: '解决重叠问题',
  48. index: 2,
  49. },
  50. {
  51. label: '列表法解决方案问题',
  52. index: 3,
  53. },
  54. {
  55. label: '单元测试',
  56. index: 4,
  57. },
  58. ]
  59. },
  60. {
  61. label: '万以内的加法和减法(一)',
  62. lock: false,
  63. children: []
  64. },
  65. {
  66. label: '万以内的加法和减法(二)',
  67. lock: false,
  68. children: []
  69. },
  70. {
  71. label: '倍的人事',
  72. lock: false,
  73. children: []
  74. },
  75. {
  76. label: '多位数乘一位数',
  77. lock: false,
  78. children: []
  79. }
  80. ]
  81. function handleBack() {
  82. uni.navigateBack();
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .parent-item {
  87. .title-layout {
  88. display: flex;
  89. justify-content: space-between;
  90. align-items: center;
  91. padding: 10px
  92. }
  93. }
  94. .child-item {
  95. padding: 10px;
  96. }
  97. </style>