<template>
    <div class="change-home">
        <div class="change-home-item" @click="changeHome">
            <span v-if="home">前往用户页</span>
            <span v-else>前往管理页</span>
        </div>
    </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;
}

</script>
<style scoped lang="scss">
</style>