set_act.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="container">
  3. <!-- 分段器区域 -->
  4. <common-controlTag :tagList="tagList" type="between" @change="changeIndex"></common-controlTag>
  5. <!-- 发起活动内容区域 -->
  6. <view class="set" v-if="currentIndex == 0">
  7. <act-set-form></act-set-form>
  8. </view>
  9. <!-- 我发起的活动内容区域 -->
  10. <view class="myset" v-if="currentIndex == 1">
  11. <my-set></my-set>
  12. </view>
  13. <!-- 我参加的活动内容区域 -->
  14. <view class="myjoin" v-if="currentIndex == 2">
  15. <my-join></my-join>
  16. </view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import { ref } from 'vue'
  21. // 分段器数组
  22. const tagList = ['发起活动', '我发起的活动', '我参加的活动']
  23. // 分段器当前索引
  24. const currentIndex = ref(0)
  25. // 切换分段器时触发的回调
  26. const changeIndex = (e) => {
  27. // console.log(e)
  28. currentIndex.value = e
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .container {
  33. padding: 20rpx 18rpx;
  34. min-height: 100vh;
  35. .set {
  36. margin-top: 20rpx;
  37. }
  38. .myset {
  39. }
  40. .myjoin {
  41. }
  42. }
  43. </style>