-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
executable file
·60 lines (57 loc) · 1.13 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
<div id="app">
<header>
<template v-if="isAuthenticated">
<router-link
to="/"
class="header-item"
>掲示板</router-link>
<span
class="header-item"
@click="logout"
>ログアウト</span>
</template>
<template v-if="!isAuthenticated">
<router-link
to="/login"
class="header-item"
>ログイン</router-link>
<router-link
to="/register"
class="header-item"
>登録</router-link>
</template>
</header>
<router-view></router-view>
</div>
</template>
<script>
export default {
computed: {
isAuthenticated() {
return this.$store.getters.idToken !== null;
}
},
methods: {
logout() {
this.$store.dispatch('logout');
}
}
};
</script>
<style scoped>
.header-item {
padding: 10px;
cursor: pointer;
}
</style>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>