关于生成的URL地址http://localhost:8080/#/后面的/#/
是路由的hash和history之分,默认是hash模式,会有#,把mode改成history,就没了
摘自:https://www.cnblogs.com/zbx-boke/p/9506376.html
vue中常用的路由模式
-
hash(#):默认路由模式
-
histroy(/)
export default new Router({
// 路由模式:hash(默认),history模式
mode: 'history',
// 修改路由高亮样式,默认值为'router-link-active'
linkActiveClass: 'active'
//路由规则
routes:[
{
path:'/',
name:'index',
component:'Index'
}
],
})

浙公网安备 33010602011771号