Files
myPrayerJournal/src/app/src/components/Navigation.vue
T

41 lines
980 B
Vue
Raw Normal View History

2017-08-05 22:48:09 -05:00
<template lang="pug">
el-menu(theme="dark" mode="horizontal" class="mpj-top-nav" router=true)
el-menu-item(index="/")
span(style="font-weight:100;") my
span(style="font-weight:600;") Prayer
span(style="font-weight:700;") Journal
el-menu-item(v-if="isAuthenticated" index="/dashboard") Dashboard
el-menu-item(v-if="isAuthenticated" index="3"): a(@click.stop="logOff()") Log Off
el-menu-item(v-if="!isAuthenticated" index="4"): a(@click.stop="logOn()") Log On
2017-07-29 16:28:27 -05:00
</template>
<script>
2017-08-05 22:48:09 -05:00
import { mapState } from 'vuex'
import AuthService from '@/auth/AuthService'
2017-07-29 16:28:27 -05:00
export default {
name: 'navigation',
2017-08-05 22:48:09 -05:00
data () {
return {
auth0: new AuthService()
}
},
methods: {
logOn () {
this.auth0.login()
},
logOff () {
this.auth0.logout(this.$store, this.$router)
}
},
computed: mapState(['isAuthenticated'])
2017-07-29 16:28:27 -05:00
}
</script>
2017-08-05 22:48:09 -05:00
<style scoped>
.mpj-top-nav {
position: fixed;
top: 0px;
width: 100%;
}
</style>