vue-bulma / vue-admin

We are refactoring it, using the latest Vue and Bulma. WIP
9.43k stars 1.61k forks source link

Question about component hierarchy #185

Closed christabella closed 7 years ago

christabella commented 7 years ago

I am confused about how each component in the views folder gets rendered with the component/layout components. For example, let's take the Form component, which is a child of uiFeatures.

I understand that generateRoutesFromMenu in router/index.js will create routes recursively so the route result for /form would be something like:

    {
      name: 'Form',
      path: '/form',
      meta: {
        link: 'ui/Form.vue'
      },
      component: lazyLoading('ui/Form')
    }

However what I don't get is how the layout components are being rendered when you go to /path. The route above seems to clearly state that when the path is /form, then the component rendered should be ui/Form.vue? So where in this page rendering process did the layout components e.g. AppMain, Navbar come into the picture?

I apologize in advance if the answer is blindingly obvious. Thank you!

christabella commented 7 years ago

Apologies, I get it now. router-view renders the pages according to the component specified in the router!