
--- client/views/pages/user/Data/Data.vue
+++ client/views/pages/user/Data/Data.vue
... | ... | @@ -188,25 +188,30 @@ |
188 | 188 |
}, |
189 | 189 |
|
190 | 190 |
clickButton(index) { |
191 |
+ this.buttons[index].clicked = !this.buttons[index].clicked; |
|
191 | 192 |
this.buttons.forEach((button, idx) => { |
192 | 193 |
if (idx === index) { |
193 |
- button.clicked = true; |
|
194 |
- this.postListSearch.ctgry_nm = button.value; |
|
195 |
- this.postSelectList(); |
|
194 |
+ if (button.clicked) { |
|
195 |
+ this.postListSearch.ctgry_nm = button.value; |
|
196 |
+ this.postSelectList(); |
|
197 |
+ } else { |
|
198 |
+ this.postListSearch.ctgry_nm = null; |
|
199 |
+ this.postSelectList(); |
|
200 |
+ } |
|
196 | 201 |
} else { |
197 | 202 |
button.clicked = false; |
198 | 203 |
} |
199 |
- |
|
200 | 204 |
}); |
205 |
+ |
|
201 | 206 |
switch (index) { |
202 | 207 |
case 0: |
203 |
- this.categoryName = '정책자료'; |
|
208 |
+ this.categoryName = this.buttons[index].clicked ? '정책자료' : '전체'; |
|
204 | 209 |
break; |
205 | 210 |
case 1: |
206 |
- this.categoryName = '연구자료'; |
|
211 |
+ this.categoryName = this.buttons[index].clicked ? '연구자료' : '전체'; |
|
207 | 212 |
break; |
208 | 213 |
default: |
209 |
- this.categoryName = '가이드라인'; |
|
214 |
+ this.categoryName = this.buttons[index].clicked ? '가이드라인' : '전체'; |
|
210 | 215 |
break; |
211 | 216 |
} |
212 | 217 |
this.scrollToBottom(); |
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?