I
I
Igor2019-08-11 19:53:59
Vue.js
Igor, 2019-08-11 19:53:59

Vue routers children not working?

Colleagues, greetings, nested routes
/view/index.js do not work

spoiler
import Index from './Index.vue'
import FoodItems from './Foods/Items.vue'
import FoodNew from './Foods/New.vue'
import FoodEdit from './Foods/New.vue'
import OrderItems from './Orders/Items.vue'

export const VIEW = {
    Index,
    FoodItems,
    FoodNew,
    FoodEdit,
    OrderItems
}

/router.js
spoiler
import Vue from "vue"
import Router from "vue-router"

import {VIEW} from "./views/index"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: "/",
      name: "Index",
      component: VIEW.Index
    },
    {
      path: "/foods",
      name: "Foods Items",
      component: VIEW.FoodItems,
      children: [
        {
          path: "new",
          component: VIEW.FoodNew
        },
        {
          path: "edit",
          component: VIEW.FoodEdit
        }
      ],
    },
    {
      path: "/orders",
      name: "Orders Items",
      component: VIEW.OrderItems
    },
    {
      path: "/about",
      name: "About",
      component: () => import( "./views/About.vue")
    }
  ]
})

Does not navigate to child routes.
Navigation only happens
Where am I messing up?
Guided by documentation

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-08-11
@IgorPI

Is there a place to display them? Did you forget to add router-viewit to FoodItems?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question