I have a scenario where I encounter the following steps:
- Go to the
/parent
page and see the Parent component being displayed - Proceed to
/parent/john
and witness the Child component being rendered - Return back to
/parent
and observe the child component being removed
Now, I am in a situation where I need to update the Parent component. Below is my current routes.js structure:
{
path: '/parent',
name: 'parent',
component: Parent,
beforeEnter: (to, from, next) => {
console.log(to, from);
next();
},
children: [
{
path: ':child',
component: Child
},
]
},
Given that beforeEnter
gets called only the first time a component is rendered, is there an alternative way to detect when the route has been updated and trigger a method on the Parent component?