Compare commits
No commits in common. "bcace5cbd71820cd6df901666f4af0134fe1fcbb" and "ac49090615855547680d0b7ecb10c78b5dc258c4" have entirely different histories.
bcace5cbd7
...
ac49090615
1 changed files with 3 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useDisplay, useTheme } from "vuetify/lib/framework.mjs";
|
import { useDisplay, useTheme } from "vuetify/lib/framework.mjs";
|
||||||
import { ref, watch } from "vue";
|
import { ref } from "vue";
|
||||||
import { navigateTo, useRoute } from "#app";
|
import { navigateTo, useRoute } from "#app";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -9,10 +9,6 @@ const { mobile } = useDisplay();
|
||||||
const navOpen = ref(!mobile.value);
|
const navOpen = ref(!mobile.value);
|
||||||
const navSelected = ref([route.path]);
|
const navSelected = ref([route.path]);
|
||||||
|
|
||||||
watch(route, (v) => {
|
|
||||||
navSelected.value = [route.path];
|
|
||||||
});
|
|
||||||
|
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
function switchTheme() {
|
function switchTheme() {
|
||||||
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark';
|
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark';
|
||||||
|
@ -26,15 +22,15 @@ function switchTheme() {
|
||||||
</VAppBar>
|
</VAppBar>
|
||||||
<VNavigationDrawer v-model="navOpen" :temporary="mobile">
|
<VNavigationDrawer v-model="navOpen" :temporary="mobile">
|
||||||
<VList v-model:selected="navSelected" density="compact" nav>
|
<VList v-model:selected="navSelected" density="compact" nav>
|
||||||
|
<VListItem prepend-icon="mdi-login" title="Login" value="/login" @click="navigateTo('/login')" />
|
||||||
<VListItem prepend-icon="mdi-account" title="Clients" value="/clients" @click="navigateTo('/clients')" />
|
<VListItem prepend-icon="mdi-account" title="Clients" value="/clients" @click="navigateTo('/clients')" />
|
||||||
<VListItem prepend-icon="mdi-receipt-text" title="Orders" value="/orders" @click="navigateTo('/orders')" />
|
<VListItem prepend-icon="mdi-receipt-text" title="Orders" value="/orders" @click="navigateTo('/orders')" />
|
||||||
<VDivider />
|
<VDivider />
|
||||||
</VList>
|
</VList>
|
||||||
<template #append>
|
<template #append>
|
||||||
<VList v-model:selected="navSelected" density="compact" nav>
|
<VList density="compact" nav>
|
||||||
<VDivider />
|
<VDivider />
|
||||||
<VListItem prepend-icon="mdi-theme-light-dark" title="Switch theme" class="mx-auto" @click="switchTheme()" />
|
<VListItem prepend-icon="mdi-theme-light-dark" title="Switch theme" class="mx-auto" @click="switchTheme()" />
|
||||||
<VListItem prepend-icon="mdi-login" title="My account" value="/login" @click="navigateTo('/login')" />
|
|
||||||
</VList>
|
</VList>
|
||||||
</template>
|
</template>
|
||||||
</VNavigationDrawer>
|
</VNavigationDrawer>
|
||||||
|
|
Loading…
Add table
Reference in a new issue