了解vue路由模式

234 阅读1分钟

vue路由模式

1.history模式以及默认的hash模式

二者的区别

1.表现形式不同 history :http://localhost:8080/about hash: http://localhost:8080/#/about 2.跳转请求 history:http://localhost:8080/id ===>发送请求 hash:不会发送请求 因为hash传参需要再路由配置那里设置占位符 3.打包前端自测要使用hash,如果使用history会出现空白页