flaschengeist-frontend/src/plugins/user/pages/User.vue

47 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<div>
<q-page
padding
class="fit row justify-center content-center items-center"
2020-10-16 07:38:14 +00:00
v-if="checkMain"
>
<q-card class="col-4" height="">
<q-card-section>
Name: {{ userObj.firstname }} {{ userObj.lastname }}<br />
E-Mail: {{ userObj.mail }}<br />
2020-10-16 07:38:14 +00:00
Roles:
<ul v-for="(role, index) in userObj.roles" :key="'role' + index">
2020-10-15 01:36:25 +00:00
<li>{{ role }}</li>
2020-10-16 07:38:14 +00:00
</ul>
<br />
Token expires: {{ sessionObj.expires }}
</q-card-section>
</q-card>
</q-page>
<router-view />
</div>
</template>
<script lang="ts">
2020-10-15 01:36:25 +00:00
import { defineComponent, computed } from '@vue/composition-api';
import { mainLink } from '../plugin';
import { Store } from 'vuex';
import { StateInterface } from 'src/store';
2020-10-15 01:36:25 +00:00
export default defineComponent({
// name: 'PageName'
2020-10-15 01:36:25 +00:00
setup(_, { root }) {
const store = <Store<StateInterface>>root.$store;
const userObj = computed(() => store.state.user.user);
const sessionObj = computed(() => store.state.user.session);
2020-10-16 07:38:14 +00:00
const checkMain = computed(() => {
return mainLink.name == root.$route.name;
});
return { userObj, sessionObj, checkMain };
}
});
</script>