forked from Mirrors/elk
fix: back button invalid (#958)
This commit is contained in:
parent
2281dc6bd0
commit
c757e45762
1 changed files with 5 additions and 2 deletions
|
@ -1,7 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const { env } = useBuildInfo()
|
const { env } = useBuildInfo()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const back = ref(router.options.history.state.back)
|
const back = ref<any>('')
|
||||||
|
onMounted(() => {
|
||||||
|
back.value = router.options.history.state.back
|
||||||
|
})
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
back.value = router.options.history.state.back
|
back.value = router.options.history.state.back
|
||||||
})
|
})
|
||||||
|
@ -23,7 +26,7 @@ router.afterEach(() => {
|
||||||
{{ $t('app_name') }} <sup text-sm italic text-secondary mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
|
{{ $t('app_name') }} <sup text-sm italic text-secondary mt-1>{{ env === 'release' ? 'alpha' : env }}</sup>
|
||||||
</div>
|
</div>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
<div hidden xl:flex items-center me-8 mt-2 :class="{ 'pointer-events-none op40': !back }">
|
<div hidden xl:flex items-center me-8 mt-2 :class="{ 'pointer-events-none op40': !back || back === '/' }">
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
:aria-label="$t('nav.back')"
|
:aria-label="$t('nav.back')"
|
||||||
@click="$router.go(-1)"
|
@click="$router.go(-1)"
|
||||||
|
|
Loading…
Reference in a new issue