hotJobs.vue 847 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <div class="box text-center default-width">
  3. <span class="mr-2">热门职位:</span>
  4. <v-btn v-for="(item, index) in jobs" :key="index" size="small" class="ml-2 mb-2" color="primary" variant="tonal" @click="handleClick(item)">{{ item.nameCn }}</v-btn>
  5. </div>
  6. </template>
  7. <script setup>
  8. import { getHotPositionList } from '@/api/common/index'
  9. import { useRouter } from 'vue-router'
  10. import { ref } from 'vue';
  11. defineOptions({ name:'personal-hotJobs-list'})
  12. const router = useRouter()
  13. const handleClick = (item) => { router.push({ path: '/recruit/position',query: item }) }
  14. // 获取行业树形
  15. let jobs = ref(null)
  16. const getTreeData = async () => {
  17. const res = await getHotPositionList()
  18. jobs.value = res.splice(0, 10) || []
  19. }
  20. getTreeData()
  21. </script>
  22. <style lang="scss" scoped>
  23. .box {
  24. margin-bottom: 24px;
  25. }
  26. </style>