components/navigation/navigation: actually watch for route changes
All checks were successful
Build dev / build (push) Successful in 1m14s
All checks were successful
Build dev / build (push) Successful in 1m14s
the useRoute() did not return ref, so the previous implementation did not work
This commit is contained in:
parent
bcace5cbd7
commit
54907d6eec
1 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue