materio-d9/web/themes/custom/materiotheme/vuejs/components/User/UserTools.vue

45 lines
719 B
Vue
Raw Normal View History

2019-04-10 10:47:45 +02:00
<template lang="html">
<div id="user-tools">
<h4>{{ mail }}</h4>
2019-05-17 18:57:24 +02:00
<a href="/admin/content/materials"
v-if="isAdmin"
>
Admin
</a>
2019-04-10 10:47:45 +02:00
<a href="/user/logout"
@click.prevent="onLogout()"
>
logout
</a>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex'
export default {
// data () {
// return {
// mail: "Hello User!"
// }
// },
computed: {
...mapState({
2019-05-17 18:57:24 +02:00
mail: state => state.User.mail,
isAdmin: state => state.User.isAdmin
2019-04-10 10:47:45 +02:00
})
},
methods: {
...mapActions({
userLogout: 'User/userLogout'
}),
onLogout () {
this.userLogout()
}
}
}
</script>
<style lang="css" scoped>
</style>