vue2 - router的两种模式 history模式与hash模式,设置模式

history模式:url带#号,兼容性好

hash模式:url不带#号,需后端配合

模式的设置:默认为history模式

export default new VueRouter({
  mode: "hash",
  routes: [
    
  ]
})

 

posted on 2023-02-18 16:03  Mikasa-Ackerman  阅读(271)  评论(0编辑  收藏  举报

导航