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
|
@ -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 New Issue