blob: 7491ea909c7304591f461e1ddf8474c69706d313 (
plain)
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
|
<script setup lang="ts">
import { watch, ref } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
const requiresAuth = ref(true)
const route = useRoute()
watch(
() => route.name,
async () => {
requiresAuth.value = route.meta.isAuth
}
)
</script>
<template>
<nav class="navbar navbar-expand-lg bg-dark" data-bs-theme="dark">
<div class="container-fluid">
<RouterLink class="navbar-brand" to="/">OpenBills</RouterLink>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div v-if="requiresAuth" class="collapse navbar-collapse" id="navbarSupportedContent">
<span class="me-auto"></span>
<ul class="navbar-nav mb-2 mb-lg-0">
<li class="nav-item">
<RouterLink to="/" class="nav-link">Home</RouterLink>
</li>
<li class="nav-item dropdown">
<a
class="nav-link dropdown-toggle"
href="#"
role="button"
data-bs-toggle="dropdown"
aria-expanded="false"
>
View
</a>
<ul class="dropdown-menu">
<li><RouterLink to="/customer" class="dropdown-item">Customers</RouterLink></li>
<li><RouterLink to="/brand" class="dropdown-item">Brands</RouterLink></li>
<li><RouterLink to="/item" class="dropdown-item">Items</RouterLink></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
</div>
</div>
</nav>
</template>
|