components/navigation/navigation: actually watch for route changes

the useRoute() did not return ref,
so the previous implementation did not work
This commit is contained in:
Wroclaw 2023-12-21 03:39:47 +01:00
parent bcace5cbd7
commit 54907d6eec

View file

@ -1,16 +1,16 @@
<script setup>
import { useDisplay, useTheme } from "vuetify/lib/framework.mjs";
import { ref, watch } from "vue";
import { navigateTo, useRoute } from "#app";
import { navigateTo, useRouter } from "#app";
const route = useRoute();
const route = useRouter().currentRoute;
const { mobile } = useDisplay();
const navOpen = ref(!mobile.value);
const navSelected = ref([route.path]);
const navSelected = ref([route.value.path]);
watch(route, (v) => {
navSelected.value = [route.path];
navSelected.value = [v.path];
});
const theme = useTheme();