4👍
If I understood your question correctly, the listening component would be the <router-view>
, so:
<router-view @reset-invoice="resetInvoice"></router-view>
And in whichever component this router view is rendered:
{
methods: {
resetInvoice() {
// ...
}
}
}
- [Vuejs]-Vue.js pagination component
- [Vuejs]-Vuetify 3 v-data-table open groups and show grouped rows by default
0👍
You should watch the route and set the props passed from the route, like below
watch: {
'$route' (to, from) {
this.user_id = this.$route.params.id
},
}
0👍
It seems I’m too late but in case someone needed it.
created() {
// watch the params of the route to fetch the data again
this.$watch(
() => this.$route.params,
() => {
//perform here your awesome logic
},
// fetch the data when the view is created and the data is
// already being observed
{ immediate: true }
)
},
- [Vuejs]-Vue class binding with strings?
- [Vuejs]-Is there any other way to fetch data instead of prefetch in vue hacker news
Source:stackexchange.com