Skip to content
Snippets Groups Projects
Commit e9794770 authored by JunGu Kang's avatar JunGu Kang
Browse files

Display Trainer Name on Navigation Bar if Logged In

parent af49f7f4
No related branches found
No related tags found
2 merge requests!37Deploy,!8#6 Display Trainer Name on Navigation Bar if Logged In
Pipeline #4115 passed
...@@ -10,11 +10,16 @@ ...@@ -10,11 +10,16 @@
></v-app-bar-nav-icon> ></v-app-bar-nav-icon>
<v-toolbar-title>FITMIN</v-toolbar-title> <v-toolbar-title>FITMIN</v-toolbar-title>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<span
v-if="isLogin"
>
{{ loginUser.name }}{{ loginUser.nickname ? `(${loginUser.nickname})` : '' }} 트레이너
</span>
</v-app-bar> </v-app-bar>
</template> </template>
<script> <script>
import { mapActions } from 'vuex'; import { mapState, mapGetters, mapActions } from 'vuex';
export default { export default {
name: 'NavigationBar', name: 'NavigationBar',
...@@ -23,6 +28,15 @@ export default { ...@@ -23,6 +28,15 @@ export default {
navDrawer: Boolean, navDrawer: Boolean,
}, },
computed: {
...mapState([
'loginUser',
]),
...mapGetters([
'isLogin',
]),
},
methods: { methods: {
...mapActions([ ...mapActions([
'toggleNavDrawer', 'toggleNavDrawer',
......
...@@ -9,7 +9,7 @@ export default new Vuex.Store({ ...@@ -9,7 +9,7 @@ export default new Vuex.Store({
isNavDrawerVisible: true, isNavDrawerVisible: true,
loginUser: null, loginUser: null,
}, },
computed: { getters: {
isLogin: state => (state.loginUser !== null), isLogin: state => (state.loginUser !== null),
}, },
mutations: { mutations: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment