buttons.vue 847 B

12345678910111213141516171819202122232425262728293031323334
  1. <!-- -->
  2. <template>
  3. <v-tabs v-model="tab" align-tabs="start" color="primary" @update:modelValue="handleUpdate" bg-color="#f7f8fa">
  4. <v-tab v-for="k in tagList" :key="k.value" :value="k.value">{{ k.title }}</v-tab>
  5. </v-tabs>
  6. </template>
  7. <script setup>
  8. defineOptions({name: 'defineOptions-buttons'})
  9. import { ref } from 'vue'
  10. import { useRouter } from 'vue-router'
  11. const router = useRouter()
  12. const props = defineProps({
  13. current: {
  14. type: Number,
  15. default: 0
  16. }
  17. })
  18. const tab = ref(props.current)
  19. const tagList = [
  20. { title: '推荐', path:'/recruit/personal/recommend', value: 0 },
  21. { title: '职位', path:'/recruit/personal/position', value: 1 },
  22. { title: '公司', path:'/recruit/personal/company', value: 2 }
  23. ]
  24. const handleUpdate = (e) => {
  25. router.push(tagList[e].path)
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. </style>