如何去掉vue路由中的#號?
vue開發(fā)時(shí)地址欄上的ip后面會(huì)跟著一個(gè)#號,如果想去掉這個(gè)井號,可以在路由上加上 mode: 'history', 即可去掉
直接上代碼如下所示:
文章來源:http://www.zghlxwxcb.cn/article/367.html
//設(shè)置路由 const router = new VueRouter({ mode: "history", base: __dirname, routes: [ { path: "/",component: Customers }, { path: "/about",component: About }, { path:"/add",component:Add }, { path:"/customers/:id",component:CustomerDetails }, { path:"/edit/:id",component:Edit } ] })
注:
文章來源地址http://www.zghlxwxcb.cn/article/367.html
到此這篇關(guān)于如何去掉vue路由中的#號?的文章就介紹到這了,更多相關(guān)內(nèi)容可以在右上角搜索或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!