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