From 55e00580d852ce826f706a276ef1501428f5fcbc Mon Sep 17 00:00:00 2001 From: "1960116313@qq.com" <1960116313@qq.com> Date: Fri, 26 Jan 2024 17:15:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AppTaskMenuList/index.vue | 3 +- src/components/AppUserInfo/index.vue | 33 +++++++++++++++++-- src/store/moules/userStore/index.d.ts | 6 ++++ src/utils/axios/index.ts | 2 +- src/views/task/components/BasicTask/index.vue | 12 +++++-- src/views/task/components/DailyTask/index.vue | 7 +++- .../task/components/NoviceTask/index.vue | 7 +++- src/views/task/components/TaskList/index.vue | 8 ++++- src/views/task/index.vue | 12 ++++--- 9 files changed, 76 insertions(+), 14 deletions(-) diff --git a/src/components/AppTaskMenuList/index.vue b/src/components/AppTaskMenuList/index.vue index 052ea65..029ab38 100644 --- a/src/components/AppTaskMenuList/index.vue +++ b/src/components/AppTaskMenuList/index.vue @@ -5,6 +5,7 @@ import { computed, inject, ref } from 'vue' import type { Task } from './index.d' import { useTaskListStore } from '@/store/moules/taskListStore' +const emits = defineEmits(['select']) const taskListStore = useTaskListStore() const sectionRefs = inject>('sectionRefs') const taskContainer = inject>('taskContainer') @@ -35,7 +36,7 @@ const list = computed(() => [ // 切换任务 function handleClick(index: number, task: string) { activeIndex.value = index - + emits('select', task) if (!sectionRefs) { return } diff --git a/src/components/AppUserInfo/index.vue b/src/components/AppUserInfo/index.vue index 93a3637..c3d1251 100644 --- a/src/components/AppUserInfo/index.vue +++ b/src/components/AppUserInfo/index.vue @@ -1,6 +1,6 @@ diff --git a/src/views/task/index.vue b/src/views/task/index.vue index 9d4906e..22258a8 100644 --- a/src/views/task/index.vue +++ b/src/views/task/index.vue @@ -19,21 +19,23 @@ const task4 = ref | null>(null) const sectionRefs = { task1, task2, task3, task4 } provide('sectionRefs', sectionRefs) provide('taskContainer', taskContainer) + +const selected = ref('task1')