2025-11-14 12:03:02 +08:00
|
|
|
<template>
|
2025-11-28 17:16:17 +08:00
|
|
|
<div class="change-home">
|
2025-11-14 15:29:02 +08:00
|
|
|
<div class="change-home-item" @click="changeHome">
|
2025-11-14 12:03:02 +08:00
|
|
|
<span v-if="home">前往用户页</span>
|
|
|
|
|
<span v-else>前往管理页</span>
|
2025-11-14 15:29:02 +08:00
|
|
|
</div>
|
2025-11-14 12:03:02 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
|
|
const home = ref<boolean>(false);
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
function changeHome(){
|
|
|
|
|
if(home.value){
|
|
|
|
|
router.push('/home');
|
|
|
|
|
}else{
|
|
|
|
|
router.push('/admin/overview');
|
|
|
|
|
}
|
|
|
|
|
home.value = !home.value;
|
|
|
|
|
}
|
2025-11-28 17:16:17 +08:00
|
|
|
|
2025-11-14 12:03:02 +08:00
|
|
|
</script>
|
2025-11-14 15:29:02 +08:00
|
|
|
<style scoped lang="scss">
|
|
|
|
|
</style>
|