vuerouter route grouping

Solutions on MaxInterview for vuerouter route grouping by the best coders in the world

showing results for - "vuerouter route grouping"
Gunner
27 Jul 2017
1// ====================================================================
2//    Routes
3// ====================================================================
4          {
5            path: '/',
6            name: 'home',
7            component: () => import('./views/Dashboard.vue'),
8          },
9// ====================================================================
10//    Grouped User Routes
11// ====================================================================
12          {
13            path: '/user',
14            name: 'user',
15            component: { render: h => h('router-view') }, 
16              // renders a router-view so no other component is needed.
17            children: [
18              {
19                path: 'list',
20                name: 'user.list',
21                component: () => import('./views/pages/User/List.vue'),
22              },
23            ]
24          },
25        ],
26      
27/*
28Aliasing createElement to h is a common convention you’ll see in 
29the Vue ecosystem and is actually required for JSX. Starting with 
30version 3.4.0 of the Babel plugin for Vue, we automatically inject 
31const h = this.$createElement in any method and getter (not functions 
32or arrow functions), declared in ES2015 syntax that has JSX, so you 
33can drop the (h) parameter. With prior versions of the plugin, your app 
34would throw an error if h was not available in the scope.
35https://vuejs.org/v2/guide/render-function.html
36*/