---
# System prepended metadata

title: 一般路由Vue Router知識點

---

# 一般路由Vue Router知識點

1. 一般routes
````
const routes = [
  {
    path: '/',
    name: '',
    component: () => import('../views/FrontLayout.vue'),
  }
````

2. 巢狀路由routes

＊＊mind: children裡面的/要拿掉

````
const routes = [
  {
    path: '/',
    name: '',
    component: () => import('../views/FrontLayout.vue'),
    children: [{
      path: '',
      name: 'Home',
      component: () => import('../views/front/HomeView.vue')
    },
    {
      path: 'about',
      name: 'About',
      component: () => import('../views/front/AboutView.vue')
    }]

  }
````
