index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <view class="page_body">
  3. <!-- 课程中心 -->
  4. <course-center v-if="state.tabBarValue=='courseCenter'"></course-center>
  5. <!-- 我的研修 -->
  6. <my-learning v-if="state.tabBarValue=='myLearning'"></my-learning>
  7. <!-- 研修监控 -->
  8. <learning-monitor v-if="state.tabBarValue=='learningMonitor'"></learning-monitor>
  9. <!-- 底部tabbar -->
  10. <page-tabbar :tabBarValue="state.tabBarValue" :tabBarList="state.tabBarList" @ChangeTabBarValue="ChangeTabBarValue"></page-tabbar>
  11. </view>
  12. </template>
  13. <script setup>
  14. import pageTabbar from '@/components/page-tabbar.vue';//头部
  15. import courseCenter from './courseCenter/index.vue';//课程中心
  16. import myLearning from './myLearning/index.vue';//我的研修
  17. import learningMonitor from './learningMonitor/index.vue';//研修监控
  18. import { reactive, ref } from 'vue';
  19. const state = reactive({
  20. tabBarValue:'courseCenter',
  21. tabBarList:[{
  22. "pathName":"courseCenter",
  23. "iconPath": "/static/image/tabbar/courseCenter.png",
  24. "selectedIconPath": "/static/image/tabbar/courseCenter_cur.png",
  25. "text": "课程中心"
  26. },{
  27. "pathName":"myLearning",
  28. "iconPath": "/static/image/tabbar/myLearning.png",
  29. "selectedIconPath": "/static/image/tabbar/myLearning_cur.png",
  30. "text": "我的研修"
  31. },{
  32. "pathName":"learningMonitor",
  33. "iconPath": "/static/image/tabbar/learningMonitor.png",
  34. "selectedIconPath": "/static/image/tabbar/learningMonitor_cur.png",
  35. "text": "研修监控"
  36. }]
  37. })
  38. //切换tabBar
  39. const ChangeTabBarValue = (name) => {
  40. state.tabBarValue = name;
  41. }
  42. </script>
  43. <style lang="scss" scoped>
  44. .page_body{
  45. height: 100%;
  46. min-height: auto;
  47. }
  48. </style>