Skip to content

Commit e89874e

Browse files
committed
Use vuex directly instead of prototype
1 parent a8ec828 commit e89874e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

generator/templates/Default/src/templates/Default.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div v-if="$store.getters['Authorisation/isLoggedIn']">
2+
<div v-if="isLoggedIn">
33
<v-navigation-drawer
44
app
55
fixed
@@ -29,6 +29,7 @@
2929
<script>
3030
import AppBarMenu from '../components/AppBarMenu.vue';
3131
import MainMenu from './../components/MainMenu.vue';
32+
import {mapGetters} from 'vuex';
3233
3334
export default {
3435
name: 'template-default',
@@ -38,6 +39,11 @@ export default {
3839
menu: true,
3940
};
4041
},
42+
computed: {
43+
...mapGetters({
44+
isLoggedIn: 'Authorisation/isLoggedIn',
45+
}),
46+
},
4147
beforeCreate() {
4248
if (!this.$store.getters['Authorisation/isLoggedIn']) {
4349
this.$router.push({name: 'login'});

0 commit comments

Comments
 (0)