

240814 정다정 오답노트 페이지 전환 수정
@5e1eb9133178fcba2d06086c464d43576301a8d6
--- client/views/layout/Menu.vue
+++ client/views/layout/Menu.vue
... | ... | @@ -1,14 +1,14 @@ |
1 | 1 |
<template> |
2 |
- <div class="menu flex" style="gap: 30px;"> |
|
2 |
+ <div class="menu flex" style="gap: 30px"> |
|
3 | 3 |
<router-link to="/MyPlan.page"> |
4 |
- <button :class="{ active: activeButton === 'schedule' }" type="submit" @click="goToApp('schedule')"> |
|
5 |
- <p :class="{ active: activeButton === 'schedule' }">학습일정계획</p> |
|
6 |
- </button> |
|
4 |
+ <button :class="{ active: activeButton === 'schedule' }" type="submit" @click="goToApp('schedule')"> |
|
5 |
+ <p :class="{ active: activeButton === 'schedule' }">학습일정계획</p> |
|
6 |
+ </button> |
|
7 | 7 |
</router-link> |
8 | 8 |
<router-link to="/Dashboard.page"> |
9 |
- <button :class="{ active: activeButton === 'dashboard' }" type="submit" @click="goToApp('dashboard')"> |
|
10 |
- <p :class="{ active: activeButton === 'dashboard' }">Dashboard</p> |
|
11 |
- </button> |
|
9 |
+ <button :class="{ active: activeButton === 'dashboard' }" type="submit" @click="goToApp('dashboard')"> |
|
10 |
+ <p :class="{ active: activeButton === 'dashboard' }">Dashboard</p> |
|
11 |
+ </button> |
|
12 | 12 |
</router-link> |
13 | 13 |
<router-link to="/MyPage.page"> |
14 | 14 |
<button :class="{ active: activeButton === 'mypage' }" type="submit" @click="goToApp('mypage')"> |
... | ... | @@ -16,49 +16,50 @@ |
16 | 16 |
</button> |
17 | 17 |
</router-link> |
18 | 18 |
</div> |
19 |
- </template> |
|
20 |
- |
|
21 |
- <script> |
|
22 |
- |
|
23 |
- |
|
24 |
- export default { |
|
19 |
+</template> |
|
20 |
+ |
|
21 |
+<script> |
|
22 |
+export default { |
|
25 | 23 |
props: { |
26 |
- currentRoute: { |
|
27 |
- type: String, |
|
28 |
- required: true |
|
29 |
- } |
|
24 |
+ currentRoute: { |
|
25 |
+ type: String, |
|
26 |
+ required: true, |
|
27 |
+ }, |
|
30 | 28 |
}, |
31 | 29 |
data() { |
32 |
- return { |
|
33 |
- activeButton: '', |
|
34 |
- }; |
|
30 |
+ return { |
|
31 |
+ activeButton: '', |
|
32 |
+ }; |
|
35 | 33 |
}, |
36 | 34 |
methods: { |
35 |
+ goToApp(button) { |
|
36 |
+ this.activeButton = button; |
|
37 |
+ }, |
|
37 | 38 |
|
38 |
- goToApp(button) { |
|
39 |
- this.activeButton = button; |
|
40 |
- }, |
|
39 |
+ // 홈 화면이면 모든 버튼을 비활성화 |
|
40 |
+ updateActiveButton() { |
|
41 |
+ if (this.currentRoute === '/MyPlan.page') { |
|
42 |
+ this.activeButton = 'schedule'; |
|
43 |
+ } |
|
44 |
+ }, |
|
41 | 45 |
|
42 |
- // 홈 화면이면 모든 버튼을 비활성화 |
|
43 |
- updateActiveButton() { |
|
44 |
- if (this.currentRoute === '/MyPlan.page') { |
|
45 |
- this.activeButton = 'schedule'; |
|
46 |
- } |
|
47 |
- } |
|
48 |
- |
|
46 |
+ // 오답노트 화면이면 모든 버튼을 비활성화 |
|
47 |
+ updateActiveButton() { |
|
48 |
+ if (this.currentRoute === '/PreviewNote.page') { |
|
49 |
+ this.activeButton = ''; |
|
50 |
+ } |
|
51 |
+ }, |
|
49 | 52 |
}, |
50 | 53 |
watch: { |
51 |
- currentRoute() { |
|
52 |
- this.updateActiveButton(); |
|
53 |
- } |
|
54 |
+ currentRoute() { |
|
55 |
+ this.updateActiveButton(); |
|
56 |
+ }, |
|
54 | 57 |
}, |
55 | 58 |
mounted() { |
56 |
- this.updateActiveButton(); |
|
57 |
- console.log('Menu mounted'); |
|
58 |
- } |
|
59 |
- }; |
|
60 |
- </script> |
|
61 |
- |
|
62 |
- <style> |
|
63 |
- </style> |
|
64 |
-(파일 끝에 줄바꿈 문자 없음) |
|
59 |
+ this.updateActiveButton(); |
|
60 |
+ console.log('Menu mounted'); |
|
61 |
+ }, |
|
62 |
+}; |
|
63 |
+</script> |
|
64 |
+ |
|
65 |
+<style></style> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?