-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTopNav.vue
105 lines (98 loc) · 2.19 KB
/
TopNav.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
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
96
97
98
99
100
101
102
103
104
105
<template>
<v-app-bar
app
color="background"
elevate-on-scroll
>
<v-img
alt="Menny's Parcel Logo"
class="shrink me-2"
contain
:src="require('../assets/logo.svg')"
transition="scale-transition"
width="40"
/>
<v-toolbar-title color="text--primary">
Menny's Parcel
</v-toolbar-title>
<v-spacer></v-spacer>
<div v-if="!$vuetify.breakpoint.mobile" class="me-5">
<v-btn
v-for="b of buttons"
:key="b.text"
exact
:to="b.to"
:disabled="!b.show"
class="mx-2"
outlined
color="primary"
active-class="secondary"
>
<v-icon left>{{ b.icon }}</v-icon>
{{ b.text }}
</v-btn>
</div>
<template v-slot:extension v-if="$vuetify.breakpoint.mobile">
<v-tabs grow>
<v-tabs-slider></v-tabs-slider>
<v-tab
v-for="b of buttons"
:key="b.text"
:to="b.to"
:disabled="!b.show"
>
<v-icon>{{ b.icon }}</v-icon>
</v-tab>
</v-tabs>
</template>
</v-app-bar>
</template>
<script>
import { mapState } from 'vuex'
export default {
computed: {
...mapState([
'simulationRunning',
'simulationDone',
]),
},
data: () => ({
buttons: [
{
text: 'Home',
to: { name: 'Home' },
icon: 'mdi-home',
show: true,
},
{
text: 'Run',
to: { name: 'Run' },
icon: 'mdi-run',
show: true,
},
{
text: 'Simulation',
to: { name: 'Simulation' },
icon: 'mdi-view-dashboard',
show: false,
},
{
text: 'Results',
to: { name: 'Results' },
icon: 'mdi-google-analytics',
show: false,
},
]
}),
watch: {
simulationRunning: function(val) {
this.buttons[2].show = val;
},
simulationDone: function(val) {
this.buttons[3].show = val;
},
}
}
</script>
<style>
</style>