From b07f961685a67a925244a8d23be6ee8d2e7ad8a4 Mon Sep 17 00:00:00 2001 From: hyql Date: Thu, 9 Jul 2026 12:25:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=95=99=E7=BB=83=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mock/coach.js | 11 ++++++++ src/views/AddCoachView.vue | 51 +++++++++++++++++++++++++++----------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/mock/coach.js b/src/mock/coach.js index 97b1c7f..f1437dc 100644 --- a/src/mock/coach.js +++ b/src/mock/coach.js @@ -56,3 +56,14 @@ export const rejoin = (id) => { const target = list.find(item => item.id === id) target.quitDate = null } + + +// 新增教练 +export const add = (coach) => { + const newCoach = { + id: list.length === 0 ? 1 : list[list.length -1].id + 1, + ...coach, + quitDate: null + } + list.push(newCoach) +} \ No newline at end of file diff --git a/src/views/AddCoachView.vue b/src/views/AddCoachView.vue index a8a9308..ed52375 100644 --- a/src/views/AddCoachView.vue +++ b/src/views/AddCoachView.vue @@ -1,19 +1,35 @@ - - - - + + \ No newline at end of file