school_form.vue 909 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="container">
  3. <!-- 分段器区域 -->
  4. <common-controlTag :tagList="tagList" :currentIndex="currentIndex" @change="changeIndex"></common-controlTag>
  5. <!-- 发起申请区域 -->
  6. <view v-if="currentIndex == 0">
  7. <school-form-launch @change="handleChange"></school-form-launch>
  8. </view>
  9. <!-- 申请记录区域 -->
  10. <view v-if="currentIndex == 1">
  11. <school-form-record></school-form-record>
  12. </view>
  13. </view>
  14. </template>
  15. <script setup>
  16. import { ref } from 'vue'
  17. // 分段器数组
  18. const tagList = ['发起申请', '申请记录']
  19. // 分段器当前索引
  20. const currentIndex = ref(0)
  21. // 切换分段器的回调
  22. const changeIndex = (e) => {
  23. currentIndex.value = e
  24. }
  25. // 自定义事件
  26. const handleChange = (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. }
  36. </style>