mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 09:05:12 +00:00
fix(client): Solve the problem of not automatically jumping to /admin/overview when accessing the /admin page for the second time (#10264)
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
This commit is contained in:
parent
228c92f2ca
commit
caf646fcb0
1 changed files with 8 additions and 1 deletions
|
@ -23,7 +23,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, onUnmounted, provide, watch } from 'vue';
|
||||
import { onActivated, onMounted, onUnmounted, provide, watch } from 'vue';
|
||||
import { i18n } from '@/i18n';
|
||||
import MkSuperMenu from '@/components/MkSuperMenu.vue';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
|
@ -204,6 +204,13 @@ onMounted(() => {
|
|||
}
|
||||
});
|
||||
|
||||
onActivated(() => {
|
||||
narrow = el.offsetWidth < NARROW_THRESHOLD;
|
||||
if (currentPage?.route.name == null && !narrow) {
|
||||
router.push('/admin/overview');
|
||||
}
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
ro.disconnect();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue