Skip to content

Commit 29ca681

Browse files
committed
refactor: inline showQR function
1 parent 4506f2a commit 29ca681

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

app/pages/projects.vue

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ const qrStates = ref<QRStates>({
1414
function toggleQR(type: keyof QRStates) {
1515
qrStates.value[type] = !qrStates.value[type]
1616
}
17-
18-
function showQR(type: keyof QRStates) {
19-
return qrStates.value[type]
20-
}
2117
</script>
2218

2319
<template>
@@ -27,7 +23,7 @@ function showQR(type: keyof QRStates) {
2723
<h2>TAT - 北科生活</h2>
2824
<div class="project-content">
2925
<img
30-
v-if="!showQR('tat')"
26+
v-if="!qrStates.tat"
3127
class="project-image shadow"
3228
src="assets/img/tat.webp"
3329
@click="toggleQR('tat')"
@@ -61,17 +57,13 @@ function showQR(type: keyof QRStates) {
6157
>
6258
</a>
6359
</div>
64-
<label
65-
v-if="0"
66-
@click="toggleQR"
67-
>顯示 QR 碼</label>
6860
</div>
6961

7062
<div class="npc-box">
7163
<h2>Shorts - 短褲</h2>
7264
<div class="project-content">
7365
<img
74-
v-if="!showQR('shorts')"
66+
v-if="!qrStates.shorts"
7567
class="project-image shadow"
7668
src="assets/img/shorts.svg"
7769
@click="toggleQR('shorts')"

0 commit comments

Comments
 (0)