task.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <HcTabsSimple :cur="tabsKey" :datas="tabsData" @tabClick="tabsClick">
  3. <template #tab-to-do>
  4. <TaskTable :tableKey="tabsKey" v-if="tabsKey === 'to-do'"/>
  5. </template>
  6. <template #tab-done>
  7. <TaskTable :tableKey="tabsKey" v-if="tabsKey === 'done'"/>
  8. </template>
  9. <template #tab-initiated>
  10. <TaskTable :tableKey="tabsKey" v-if="tabsKey === 'initiated'"/>
  11. </template>
  12. <template #tab-copied>
  13. <TaskTable :tableKey="tabsKey" v-if="tabsKey === 'copied'"/>
  14. </template>
  15. </HcTabsSimple>
  16. </template>
  17. <script setup>
  18. import {ref, watch} from "vue";
  19. import TaskTable from "../components/TaskTable.vue";
  20. //选项卡
  21. const tabsKey = ref('to-do')
  22. const tabsData = ref([
  23. {icon: 'time', label: '待办任务', key: 'to-do'},
  24. {icon: 'calendar-check', label: '已办任务', key: 'done'},
  25. {icon: 'user-shared', label: '我发起的任务', key: 'initiated'},
  26. {icon: 'user-received', label: '抄送给我的', key: 'copied'},
  27. ])
  28. const tabsClick = (key) => {
  29. tabsKey.value = key
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. </style>
  34. <style lang="scss">
  35. </style>