-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.task.vue
More file actions
57 lines (50 loc) · 1.08 KB
/
App.task.vue
File metadata and controls
57 lines (50 loc) · 1.08 KB
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
<template>
<div id="app">
<div id="nav">
<router-link to="/">Vue Recipes</router-link>|
<span v-if="!$root.store.username">
Guest:
<router-link to="/register">Register</router-link>|
<router-link to="/login">Login</router-link>|
</span>
<span v-else>
{{ $root.store.username }}: <button @click="Logout">Logout</button>|
</span>
</div>
<router-view />
</div>
</template>
<script>
export default {
name: "App",
methods: {
Logout() {
this.$root.store.logout();
this.$root.toast("Logout", "User logged out successfully", "success");
this.$router.push("/").catch(() => {
this.$forceUpdate();
});
}
}
};
</script>
<style lang="scss">
@import "@/scss/form-style.scss";
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
min-height: 100vh;
}
#nav {
padding: 30px;
}
#nav a {
font-weight: bold;
color: #2c3e50;
}
#nav a.router-link-exact-active {
color: #42b983;
}
</style>