RDowns
RDowns

Reputation: 659

How to get this child component to render with view router in vue.js?

When a user logs in they are directed to LoggedIn.vue

This component has a child component called TasksActions.vue which I also want to render. I get no errors but the child, TasksActions.vue does not render.

Routes.js

enter image description here

LoggedIn.vue

enter image description here

TasksActions.vue

enter image description here

Upvotes: 0

Views: 64

Answers (3)

drew kroft
drew kroft

Reputation: 916

You never specified, are you actually directing the user to /taskactions at any point?

You can do this programmatically if needed as well:

this.$router.push({name: 'taskactions'});

Upvotes: 1

Ronin Kr
Ronin Kr

Reputation: 111

Could you please try like this:

{
  path: '/loggedin',
  component: LoggedIn,
  redirect: '/loggedin/taskactions'
  children: [
    path: 'taskactions',
    ...
  ]
}

Upvotes: 0

waleed ali
waleed ali

Reputation: 1195

I guess, the problem is you have two routes with the same path value / and the first one gets precedence and since it doesn't have any child component, you don't see anything there.

Upvotes: 0

Related Questions