2
2

App.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <script setup lang="ts">
  2. import { ref, onMounted } from 'vue'
  3. import { useJobStore } from './stores/jobStore'
  4. import JobManagementView from './views/JobManagementView.vue'
  5. import CandidateView from './views/CandidateView.vue'
  6. import DashboardView from './views/DashboardView.vue'
  7. import BottomNavigation from './components/BottomNavigation.vue'
  8. const jobStore = useJobStore()
  9. const currentView = ref('jobs')
  10. const views = {
  11. jobs: JobManagementView,
  12. candidates: CandidateView,
  13. dashboard: DashboardView
  14. }
  15. const handleNavChange = (view: string) => {
  16. currentView.value = view
  17. }
  18. onMounted(() => {
  19. // 初始化应用数据
  20. jobStore.initializeData()
  21. })
  22. </script>
  23. <template>
  24. <div class="min-h-screen bg-gradient-to-br from-gray-50 via-blue-50/30 to-purple-50/30 flex flex-col">
  25. <!-- 主内容区域 -->
  26. <main class="flex-1 pb-20 safe-area-top">
  27. <Transition
  28. name="page"
  29. mode="out-in"
  30. appear
  31. >
  32. <component
  33. :is="views[currentView]"
  34. :key="currentView"
  35. class="min-h-full"
  36. />
  37. </Transition>
  38. </main>
  39. <!-- 底部导航栏 -->
  40. <BottomNavigation
  41. :current-view="currentView"
  42. @change="handleNavChange"
  43. class="safe-area-bottom"
  44. />
  45. </div>
  46. </template>
  47. <style scoped>
  48. /* 页面切换动画 */
  49. .page-enter-active,
  50. .page-leave-active {
  51. transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  52. }
  53. .page-enter-from {
  54. opacity: 0;
  55. transform: translateX(20px);
  56. }
  57. .page-leave-to {
  58. opacity: 0;
  59. transform: translateX(-20px);
  60. }
  61. </style>