HeaderComponent.vue
1.19 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
<template>
<v-app-bar app clipped-left>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-toolbar-title>APP CONTENTS</v-toolbar-title>
<v-spacer />
<v-menu offset-y min-width="200">
<template v-slot:activator="{ on }">
<v-btn icon v-on="on">
<v-icon>person</v-icon>
</v-btn>
</template>
<v-list>
<v-list-item to="/myaccount">
<v-list-item-title>계정</v-list-item-title>
</v-list-item>
<v-list-item @click="logout">
<v-list-item-title>로그아웃</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-app-bar>
</template>
<script>
export default {
name: "HeaderComponent",
props: {
source: String
},
methods: {
async logout() {
try {
await this.$store.dispatch("user/logout");
await this.$store.commit("file/InitialFiles");
await this.$router.replace("/");
} catch (e) {
console.error(e);
}
}
}
};
</script>
<style scoped>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #2c3e50;
}
</style>