Skip to content

Commit ff6a9fd

Browse files
authored
chore: use onMounted
1 parent 2f3a978 commit ff6a9fd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/composables/useCanGoBack.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
export function useCanGoBack() {
22
const canGoBack = ref(false)
33

4-
if (import.meta.client) {
5-
const router = useRouter()
4+
const router = useRouter()
5+
6+
onMounted(() => {
67
canGoBack.value = router.options.history.state.back !== null
7-
}
8+
})
89

910
return canGoBack
1011
}

0 commit comments

Comments
 (0)