blob: bf287b25fe520eb817bf1ed0753236e59aede031 (
plain) (
blame)
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
|
<template>
<div id="navbar">
<nav class="navbar">
<div class="navbar-brand">
<div class="navbar-item">
<img src="@/assets/logo.png" />
</div>
<a class="navbar-burger burger" v-on:click="toggleNavMenu">
<span></span>
<span></span>
<span></span>
</a>
</div>
<div :class="navMenu">
<div class="navbar-start">
<a class="navbar-item">
<router-link to="/">Home</router-link>
</a>
<a class="navbar-item">
<router-link to="/about">About</router-link>
</a>
</div>
<div class="navbar-end">
<div class="navbar-item">
<div class="buttons">
<button class="button">
Cart (5)
</button>
<button class="button is-primary">
Checkout
</button>
</div>
</div>
</div>
</div>
</nav>
</div>
</template>
<script>
export default {
name: "Navbar",
data() {
return {
isMenuActive: false
};
},
computed: {
navMenu() {
if (this.isMenuActive) {
return "navbar-menu is-active";
} else {
return "navbar-menu";
}
}
},
methods: {
toggleNavMenu() {
this.isMenuActive = !this.isMenuActive;
}
}
};
</script>
|