1. 实现vue前端路由的两种方式:
  2. 改变location.hash
  3. history,pushState(obj,data,url)
  4. history.replaceState()
  5. history.go()
  6. history.back()
  7. history.forward()
  8. router-link是vue内置标签,它会被渲染成一个a标签
linkActiveClassn属性: 改变 router-link-active的名称
replace: 不留下历史记录
tag: 渲染成什么标签
  1. Router属性
const router = new Router({
  mode: 'history',
  linkActiveClass: 'active',
  routes: [
    {
      path: '/',    
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      children: [
        {
          path: "",
          redirect: "news",
        },
        {
          path: 'news',
          name: 'homeNews',
          component: homeNews
        }
      ],
      meta: {
        title: '首页'
      }
    },
  ]
})