详情页面切换

This commit is contained in:
851673013@qq.com 2022-06-14 19:35:48 +08:00
parent ea9f61ede8
commit 9706fd18b3
1 changed files with 18 additions and 2 deletions

View File

@ -28,7 +28,8 @@
import AbilityToRecommendBottom from '@/views/home/components/AbilityToRecommendBottom'
import AlgorithmDetails from '@/views/detailsAll/AlgorithmDetails'
import ApplicationDetails from '@/views/detailsAll/ApplicationDetails'
import { selectOne } from '@/api/home'
import { useRouter } from 'vue-router'
export default defineComponent({
name: '',
props: {},
@ -74,11 +75,26 @@
label: '交通运输局',
},
])
const showView = ref('application-details')
const router = useRouter()
const id = router.currentRoute.value.query.id
let showView = ref('algorithm-details')
const init = () => {
selectOne(id).then((res) => {
if (res.data.data.type == '组件服务') {
showView.value = 'algorithm-details'
} else {
showView.value = 'application-details'
}
})
}
init()
return {
formState,
options,
showView,
init,
router,
id,
}
},
})