vue 动态路由 和 路由模式

vue 的路由跳转 

  声明式路由:<router-link><router-link>

  编程式跳转: this.$router.push(`/path${id}`)   & this.$router.push({name:'detail', params:{id}})

动态路由

   {

    path:'/main/:id',

    name: 'Main',

    comp......

   }

vue 路由模式分为 hash 和 history 两种模式 地址连表现区别是 前者有# 不是很美观  如果使用history模式 需要和后端事先沟通后端没有配置的路由要统一返回index.html 

原文地址:https://www.cnblogs.com/jshe/p/13229991.html