1

I am using <router-view> for nested routing in my Vue application. The child component has a link component, and when I click the link, it doesn't update the parent component, but only the child component. Does anyone know how to fix this?

router.js

...
{
  path: 'companies/:id',
  component: () => import('.../companies/view/index'),
  children: [
    {
      path: 'info',
      component: () => import('.../companies/view/info'),
    },
    {
      path: 'address',
      component: () => import('.../companies/view/address'),
    }
  ]
...

I placed the <router-view> component in the index.vue file to show info and address components.

In the info.vue,

<router-link to="companies/11/address">address</router-link>
bli07
  • 673
  • 1
  • 5
  • 16

1 Answers1

1

Vue Routing - Reacting to Params Changes

Should update the component on route param changes.

bli07
  • 673
  • 1
  • 5
  • 16