<template>
    <view class="page-content">
        <mx-nav-bar title="生涯测评结果"/>
        <mx-tabs-swiper v-model="current" :tabs="tabs" border>
            <template #holland>
                <holland-list/>
            </template>
            <template #mbti>
                <mbti-list/>
            </template>
        </mx-tabs-swiper>
    </view>
</template>

<script setup>
import {ref, onMounted} from 'vue'
import _ from 'lodash'
import {useTransfer} from "@/hooks/useTransfer";
import HollandList from "@/pagesOther/pages/test-center/list/components/holland-list.vue";
import MbtiList from "@/pagesOther/pages/test-center/list/components/mbti-list.vue";

const current = ref(0)
const {prevData} = useTransfer()

const tabs = [
    {name: '专业兴趣(HOLLAND)', template: 'holland'},
    {name: '职业性格(MBTI)', template: 'mbti'}
]

onMounted(() => {
    const matchIdx = _.findIndex(tabs, t => t.template == prevData.value.type)
    current.value = matchIdx > -1 ? matchIdx : 0
})
</script>

<style lang="scss">

</style>
