Skip to content

Commit 53945dc

Browse files
committed
🐛 [fix] Logo 클릭 시 메인 페이지로 이동 기능 누락 수정
1 parent 0260502 commit 53945dc

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/components/top-bar/SideBar.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
@click="$emit('close')"
1414
class="cursor-pointer"
1515
:name="hamburgerIcon" />
16-
<img src="/MainLogo.svg" />
16+
<button @click="onLogoClick">
17+
<img src="/MainLogo.svg" />
18+
</button>
1719
</div>
1820
<div class="flex-1 overflow-y-auto flex flex-col gap-6">
1921
<div
@@ -65,7 +67,7 @@
6567
</template>
6668

6769
<script setup lang="ts">
68-
import { useRoute } from 'vue-router'
70+
import { useRoute, useRouter } from 'vue-router'
6971
import { computed } from 'vue'
7072
import CommonIcons from '../common/CommonIcons.vue'
7173
import { hamburgerIcon } from '@/constants/iconPath'
@@ -78,9 +80,10 @@ const memberStore = useMemberStore()
7880
const { info } = storeToRefs(memberStore)
7981
8082
const { isOpen } = defineProps<{ isOpen: boolean }>()
81-
defineEmits(['close'])
83+
const emit = defineEmits(['close'])
8284
8385
const route = useRoute()
86+
const router = useRouter()
8487
8588
const role = computed(() => info.value.role)
8689
const name = computed(() => info.value.name)
@@ -93,4 +96,9 @@ const filteredMenu = computed(() => {
9396
? SIDE_MANAGER_MENU
9497
: SIDE_ADMIN_MENU
9598
})
99+
100+
const onLogoClick = () => {
101+
emit('close')
102+
router.push('/')
103+
}
96104
</script>

src/components/top-bar/TopBar.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
@click="onOpenSide">
99
<CommonIcons :name="hamburgerIcon" />
1010
</button>
11-
<img src="/MainLogo.svg" />
11+
<button @click="router.push('/')">
12+
<img src="/MainLogo.svg" />
13+
</button>
1214
</div>
1315
<div
1416
v-if="isLogined"
@@ -63,9 +65,11 @@ import ProfileModal from './ProfileModal.vue'
6365
import { getNotifiCount } from '@/api/common'
6466
import ImageContainer from '../common/ImageContainer.vue'
6567
import { useOutsideClick } from '@/hooks/useOutsideClick'
68+
import { useRouter } from 'vue-router'
6669
6770
const memberStore = useMemberStore()
6871
const { isLogined, info } = storeToRefs(memberStore)
72+
const router = useRouter()
6973
7074
onMounted(async () => {
7175
if (isLogined.value) {

0 commit comments

Comments
 (0)