123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <template lang="html">
- <div id="user-tools">
- <h4
- class="mdi mdi-account"
- >{{ mail }}</h4>
- <a href="/admin/content/materials"
- v-if="isAdmin"
- class="mdi mdi-settings"
- title="admin"
- ></a>
- <a href="/user/logout"
- @click.prevent="onLogout()"
- class="mdi mdi-logout"
- title="logout"
- ></a>
- </div>
- </template>
- <script>
- import { mapState, mapActions } from 'vuex'
- export default {
- // data () {
- // return {
- // mail: "Hello User!"
- // }
- // },
- computed: {
- ...mapState({
- mail: state => state.User.mail,
- isAdmin: state => state.User.isAdmin
- })
- },
- methods: {
- ...mapActions({
- userLogout: 'User/userLogout'
- }),
- onLogout () {
- console.log('UserTools onLogout');
- this.userLogout()
- }
- }
- }
- </script>
- <style lang="css" scoped>
- #user-tools{
- margin-right:0.5em;
- padding-right:0.5em;
- border-right:1px solid #222;
- }
- h4{
- margin:0;
- display:inline-block;
- font-size:inherited;
- }
- </style>
|