Blame view
src/components/AppToolbar.vue
2.7 KB
93a68cfa1
|
1 2 |
<template> <v-toolbar |
8fc85e8ec
|
3 |
color="grey" |
93a68cfa1
|
4 |
fixed |
93a68cfa1
|
5 |
app |
defcc5da3
|
6 |
> |
03dcbf0c1
|
7 8 9 |
<v-toolbar-title class="ml-0 pl-3"> <v-toolbar-side-icon @click.stop="handleDrawerToggle" class="hide"></v-toolbar-side-icon> </v-toolbar-title> |
93a68cfa1
|
10 |
<v-spacer></v-spacer> |
659b42db7
|
11 |
<h5 class="white--text name">{{userName}}</h5> |
93a68cfa1
|
12 13 |
<v-menu offset-y origin="center center" :nudge-bottom="10" transition="scale-transition"> <v-btn icon large flat slot="activator"> |
269061695
|
14 15 |
<v-avatar size="40px"> <img src="/static/icon/user.png"/> |
93a68cfa1
|
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
</v-avatar> </v-btn> <v-list class="pa-0"> <v-list-tile v-for="(item,index) in items" :to="!item.href ? { name: item.name } : null" :href="item.href" @click="item.click" ripple="ripple" :disabled="item.disabled" :target="item.target" rel="noopener" :key="index"> <v-list-tile-action v-if="item.icon"> <v-icon>{{ item.icon }}</v-icon> </v-list-tile-action> <v-list-tile-content> <v-list-tile-title>{{ item.title }}</v-list-tile-title> </v-list-tile-content> </v-list-tile> </v-list> </v-menu> </v-toolbar> </template> <script> |
03dcbf0c1
|
32 33 |
import NotificationList from "@/components/widgets/list/NotificationList"; import Util from "@/util"; |
93a68cfa1
|
34 |
export default { |
03dcbf0c1
|
35 36 |
search: "", name: "app-toolbar", |
93a68cfa1
|
37 38 39 40 |
components: { NotificationList }, data: () => ({ |
03dcbf0c1
|
41 |
search: "", |
eba96ec51
|
42 |
userName:'', |
93a68cfa1
|
43 44 45 |
items: [ { // icon: 'account_circle', |
03dcbf0c1
|
46 47 48 |
href: "/changepassword", title: "Change Password", click: e => { |
93a68cfa1
|
49 50 51 52 53 54 55 56 57 58 59 60 61 |
console.log(e); } }, // { // icon: 'settings', // href: '#', // title: 'Settings', // click: (e) => { // console.log(e); // } // }, { // icon: 'fullscreen_exit', |
03dcbf0c1
|
62 63 64 65 66 |
href: "#", title: "Logout", click: e => { window.getApp.$emit("APP_LOGOUT"); // this.$store.dispatch("setToken", null); |
93a68cfa1
|
67 68 |
} } |
03dcbf0c1
|
69 |
] |
93a68cfa1
|
70 71 |
}), computed: { |
03dcbf0c1
|
72 |
toolbarColor() { |
93a68cfa1
|
73 74 75 76 |
return this.$vuetify.options.extra.mainNav; } }, methods: { |
03dcbf0c1
|
77 78 |
handleDrawerToggle() { window.getApp.$emit("APP_DRAWER_TOGGLED"); |
93a68cfa1
|
79 |
}, |
03dcbf0c1
|
80 |
handleFullScreen() { |
93a68cfa1
|
81 82 |
Util.toggleFullScreen(); } |
eba96ec51
|
83 |
}, |
ac10393a4
|
84 |
mounted(){ |
eba96ec51
|
85 86 |
this.userName = this.$store.state.name; } |
93a68cfa1
|
87 88 |
}; </script> |
03dcbf0c1
|
89 90 91 92 93 94 95 96 |
<style> .v-icon{ font-size:30px; } @media screen and (min-width: 1270px){ .hide{ display: none; } |
a0fe54618
|
97 98 99 |
/* } @media screen and (max-width: 962px) { .imglogo{ |
659b42db7
|
100 101 102 103 104 |
position: absolute; top: 13px; left: 13px !important; width: 70px; height: 24px; |
f42c1d9c9
|
105 |
} */ |
a0fe54618
|
106 |
} |
a647b5fbe
|
107 |
@media screen and (max-width: 420px){ |
03dcbf0c1
|
108 109 110 111 |
.v-list__tile { font-size:14px; padding: 0 10px; } |
659b42db7
|
112 113 114 |
.name{ font-size:15px; } |
03dcbf0c1
|
115 116 |
} </style> |