index.vue 1.2 KB

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