1、改變路由的哈希模式(在路由中會出現#):
在src/router/index.js中
創建路由對象:
const routes = [
{path:"",redirect:"/home"},
{path:"/home",component:Home},
{path:"/cart",comsponent:Cart},
{path:"/profile",component:Profile},
{path:"/category",component:Cart},
]
const router = new Vuerouter({
routes,
mode:'history'
})
export default router
將mode改為"history"