how to watch route like options api #1862
Replies: 1 comment
-
<script setup lang="ts">
import { useRoute } from "vue-router";
import { watch } from "vue";
const route = useRoute();
watch(
() => route.fullPath,
(to, from) => {
console.log(`to:${to}`);
console.log(`from:${from}`);
},
{ immediate: true }
);
</script> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
use options api I can watch the route where it is from and where it come
when I use composition-api
to and from is the same object
Beta Was this translation helpful? Give feedback.
All reactions