Skip to content

Commit d37f059

Browse files
committed
refactor: simplify click event handlers in Archive component for improved readability
1 parent 8d28969 commit d37f059

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

frontend/src/views/Archive.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@
9999
:key="course.label"
100100
class="p-button-text search-result-btn text-color"
101101
@click="
102-
filterBySubject({ label: course.label, id: course.id })
103-
sidebarVisible = false
102+
() => {
103+
filterBySubject({ label: course.label, id: course.id })
104+
sidebarVisible = false
105+
}
104106
"
105107
>
106108
<span class="ellipsis">{{ course.label }}</span>
@@ -118,8 +120,10 @@
118120
icon="pi pi-cog"
119121
label="系統管理"
120122
@click="
121-
router.push('/admin')
122-
sidebarVisible = false
123+
() => {
124+
router.push('/admin')
125+
sidebarVisible = false
126+
}
123127
"
124128
severity="secondary"
125129
size="small"

0 commit comments

Comments
 (0)