list.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="page-content">
  3. <mx-nav-bar title="生涯测评结果"/>
  4. <mx-tabs-swiper v-model="current" :tabs="tabs" border>
  5. <template #holland>
  6. <holland-list/>
  7. </template>
  8. <template #mbti>
  9. <mbti-list/>
  10. </template>
  11. </mx-tabs-swiper>
  12. </view>
  13. </template>
  14. <script setup>
  15. import {ref, onMounted} from 'vue'
  16. import _ from 'lodash'
  17. import {useTransfer} from "@/hooks/useTransfer";
  18. import HollandList from "@/pages/test-center/list/components/holland-list.vue";
  19. import MbtiList from "@/pages/test-center/list/components/mbti-list.vue";
  20. const current = ref(0)
  21. const {prevData} = useTransfer()
  22. const tabs = [
  23. {name: '专业兴趣(HOLLAND)', template: 'holland'},
  24. {name: '职业性格(MBTI)', template: 'mbti'}
  25. ]
  26. onMounted(() => {
  27. const matchIdx = _.findIndex(tabs, t => t.template == prevData.value.type)
  28. current.value = matchIdx > -1 ? matchIdx : 0
  29. })
  30. </script>
  31. <style lang="scss">
  32. </style>