sintonia_webapp/resources/js/components/header/UserInfo.vue
2025-07-18 14:10:37 +02:00

34 lines
No EOL
706 B
Vue

<script setup lang="ts">
import {useRouter} from "vue-router";
import {useAuthStore} from "@/stores/auth.store.ts";
import axios from "axios";
const router = useRouter();
const auth = useAuthStore();
const userName = auth.userData.login;
const logout = async () => {
await auth.logout()
router.push({ path: 'login' });
};
</script>
<template>
<v-sheet
:width="150"
>
<v-btn color="info" :to="{ path: 'user-profile'}">{{ userName }} {{ $t('header.userinfo.info') }}</v-btn>
<v-btn color="" @click="logout">{{ $t('header.userinfo.logout') }}</v-btn>
</v-sheet>
</template>
<style scoped>
div button {
width: 100%;
}
div button:not(:first-child) {
margin-top: 2px;
}
</style>