import { defineComponent, useRoute, watch } from "@nuxtjs/composition-api";
export default defineComponent({
setup(props) {
const route = useRoute();
watch(
()=>route.value.hash,
(newVal,oldVal) => {
console.log('routewatch',newVal, oldVal);
},
{immediate: true}
)
}
}
Nuxt2+Composition APIのhistoryモードでのhashのwatch