Blame view
src/components/pageHeader/AppDrawer.vue
6.85 KB
93a68cfa1
|
1 2 3 4 5 6 7 8 9 |
<template> <v-navigation-drawer id="appDrawer" :mini-variant.sync="mini" fixed :dark="$vuetify.dark" app v-model="drawer" width="260" |
687e0b929
|
10 11 12 13 |
> <v-toolbar class="fixcolors"> <img v-bind:src="computeLogo" height="40" width="150" class="imgLogo" alt="ana" /> <v-toolbar-title class="ml-0 pl-3"></v-toolbar-title> |
93a68cfa1
|
14 15 16 17 |
</v-toolbar> <vue-perfect-scrollbar class="drawer-menu--scroll" :settings="scrollSettings"> <v-list dense expand> <template v-for="(item, i) in menus"> |
687e0b929
|
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<!--group with subitems--> <v-list-group v-if="item.items" :key="item.name" :group="item.group" no-action="no-action" > <v-list-tile slot="activator" ripple="ripple"> <v-list-tile-action v-if="item.icon" class="pr-3"> <img :src="item.icon" width="40" alt="icons" /> </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> <template v-for="(subItem, i) in item.items"> <!--sub group--> <v-list-group v-if="subItem.items" :key="subItem.name" :group="subItem.group" sub-group="sub-group" > <v-list-tile slot="activator" ripple="ripple"> |
93a68cfa1
|
42 |
<v-list-tile-content> |
687e0b929
|
43 |
<v-list-tile-title>{{ subItem.title }}</v-list-tile-title> |
93a68cfa1
|
44 |
</v-list-tile-content> |
93a68cfa1
|
45 |
</v-list-tile> |
687e0b929
|
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
<v-list-tile v-for="(grand, i) in subItem.children" :key="i" :to="genChildTarget(item, grand)" :href="grand.href" ripple="ripple" > <v-list-tile-content> <v-list-tile-title>{{ grand.title }}</v-list-tile-title> </v-list-tile-content> </v-list-tile> </v-list-group> <!--child item--> <v-list-tile v-else :key="i" :to="genChildTarget(item, subItem)" :href="subItem.href" :disabled="subItem.disabled" :target="subItem.target" ripple="ripple" > <v-list-tile-action v-if="subItem.action"> <img width="30" :src="subItem.action" :class="[subItem.actionClass || 'success--text']" /> </v-list-tile-action> <v-list-tile-content> <v-list-tile-title class="body-2"> <span>{{ subItem.title }}</span> </v-list-tile-title> </v-list-tile-content> <!-- <v-circle class="white--text pa-0 circle-pill" v-if="subItem.badge" color="red" disabled="disabled">{{ subItem.badge }}</v-circle> --> </v-list-tile> </template> </v-list-group> <v-subheader v-else-if="item.header" :key="i">{{ item.header }}</v-subheader> <v-divider v-else-if="item.divider" :key="i"></v-divider> <!--top-level link--> <v-list-tile v-else ripple="ripple" :disabled="item.disabled" :target="item.target" rel="noopener" :key="item.path" > <a :href="item.path"> |
93a68cfa1
|
96 |
<v-list-tile-action v-if="item.icon"> |
687e0b929
|
97 |
<img :src="item.icon" width="40" alt="icons" /> |
93a68cfa1
|
98 |
</v-list-tile-action> |
687e0b929
|
99 |
<v-list-tile-content class="pl-3 mt-2"> |
93a68cfa1
|
100 101 102 103 |
<v-list-tile-title>{{ item.title }}</v-list-tile-title> </v-list-tile-content> <!-- <v-circle class="white--text pa-0 chip--x-small" v-if="item.badge" :color="item.color || 'primary'" disabled="disabled">{{ item.badge }}</v-circle> --> <v-list-tile-action v-if="item.subAction"> |
687e0b929
|
104 105 |
<!-- <v-icon class="success--text">{{ item.subAction }}</v-icon> --> <img :src="item.icon" width="40" alt="icons" /> |
93a68cfa1
|
106 107 |
</v-list-tile-action> <!-- <v-circle class="caption blue lighten-2 white--text mx-0" v-else-if="item.chip" label="label" small="small">{{ item.chip }}</v-circle> --> |
687e0b929
|
108 109 |
</a> </v-list-tile> |
93a68cfa1
|
110 |
</template> |
687e0b929
|
111 112 |
</v-list> </vue-perfect-scrollbar> |
93a68cfa1
|
113 114 115 |
</v-navigation-drawer> </template> <script> |
687e0b929
|
116 117 |
import menu from "@/api/menu"; import VuePerfectScrollbar from "vue-perfect-scrollbar"; |
93a68cfa1
|
118 |
export default { |
687e0b929
|
119 |
name: "app-drawer", |
93a68cfa1
|
120 |
components: { |
687e0b929
|
121 |
VuePerfectScrollbar |
93a68cfa1
|
122 123 124 125 126 |
}, props: { expanded: { type: Boolean, default: true |
687e0b929
|
127 |
} |
93a68cfa1
|
128 129 130 131 132 133 134 |
}, data: () => ({ mini: false, drawer: true, menus: menu, scrollSettings: { maxScrollbarLength: 160 |
687e0b929
|
135 |
} |
93a68cfa1
|
136 137 |
}), computed: { |
687e0b929
|
138 |
computeGroupActive() { |
93a68cfa1
|
139 140 |
return true; }, |
687e0b929
|
141 142 |
computeLogo() { return "/static/logoIntrack.png"; |
55f72b7d7
|
143 |
}, |
93a68cfa1
|
144 |
|
687e0b929
|
145 |
sideToolbarColor() { |
93a68cfa1
|
146 |
return this.$vuetify.options.extra.sideNav; |
687e0b929
|
147 |
} |
93a68cfa1
|
148 |
}, |
687e0b929
|
149 150 151 |
created() { window.getApp.$on("APP_DRAWER_TOGGLED", () => { this.drawer = !this.drawer; |
93a68cfa1
|
152 153 |
}); }, |
93a68cfa1
|
154 155 |
methods: { |
687e0b929
|
156 |
genChildTarget(item, subItem) { |
93a68cfa1
|
157 158 159 |
if (subItem.href) return; if (subItem.component) { return { |
687e0b929
|
160 |
name: subItem.component |
93a68cfa1
|
161 162 |
}; } |
687e0b929
|
163 164 |
return { name: `${item.group}/${subItem.name}` }; } |
93a68cfa1
|
165 166 167 168 169 170 171 |
} }; </script> <style lang="stylus"> // @import '../../node_modules/vuetify/src/stylus/settings/_elevations.styl'; |
687e0b929
|
172 173 |
#appDrawer { overflow: hidden; |
93a68cfa1
|
174 |
|
687e0b929
|
175 176 177 178 179 180 181 182 |
.drawer-menu--scroll { height: calc(100vh - 48px); overflow: auto; } } .v-list__group__items--no-action .v-list__tile { padding-left: 72px !important; } |
03dcbf0c1
|
183 |
.v-list--dense .v-list__tile:not(.v-list__tile--avatar) { |
687e0b929
|
184 185 |
height: 60px; font-size: 17px; |
03dcbf0c1
|
186 |
} |
687e0b929
|
187 |
|
03dcbf0c1
|
188 |
.v-list__tile__action { |
687e0b929
|
189 |
min-width: 36px; |
03dcbf0c1
|
190 |
} |
687e0b929
|
191 192 193 194 195 |
.v-list__tile.primary--text a { color: black !important; border-left: 4px solid black; border-radius: 4px; |
03dcbf0c1
|
196 |
} |
687e0b929
|
197 198 199 |
@media screen and (max-width: 420px) { .v-list--dense .v-list__tile:not(.v-list__tile--avatar) { |
03dcbf0c1
|
200 |
font-size: 14px; |
687e0b929
|
201 202 203 204 205 206 |
} .imgLogo { height: 32px; width: 120px; } |
03dcbf0c1
|
207 |
} |
93a68cfa1
|
208 |
</style> |
d75967ec2
|
209 210 211 |
<style scoped> |
687e0b929
|
212 213 214 |
.theme--light .v-icon, .application .theme--light.v-icon { color: #39b982; |
d75967ec2
|
215 |
} |
687e0b929
|
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
a { text-decoration: none; display: inherit; color: black; } a:hover { color: gray !important; /* border-left: 4px solid black; */ /* border-radius: 4px; */ } /* a:active { color: red !important; } */ /* a:visited { border-left: 4px solid black; border-radius: 4px; } */ /* visited link */ /* a:visited { color: black !important; border-left: 4px solid black; border-radius: 4px; } a:active { color: black !important; border-left: 4px solid black; border-radius: 4px; } */ |
d75967ec2
|
244 |
</style> |