亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

解決vue+router路由跳轉(zhuǎn)不起作用的一項(xiàng)原因

 更新時(shí)間:2020年07月19日 15:33:15   作者:浪漫的程序猿  
這篇文章主要介紹了解決vue+router路由跳轉(zhuǎn)不起作用的一項(xiàng)原因,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧

如下所示:

Vue.use(Router)
export default new Router({
mode:'history',
routes: [
   { path: '/', component: Login },
   { path: '/login', component: Login },
   { path: '/register',component: Register},
   {path: '/*', component: NotFound},
    ]
})

記得要寫上 mode:'history', 原因如下

補(bǔ)充知識:vue-router配置后地址欄輸入跳轉(zhuǎn)不成功問題

在起服務(wù)的js中增加 connect-history-api-fallback

const history = require('connect-history-api-fallback');
 
// 在靜態(tài)頁面之前,這一句:app.use('/static', express.static(__dirname + '/public'))之前設(shè)置history
const historyConfig = {
 index: '/index.html'
};
app.use(history(historyConfig));

以上這篇解決vue+router路由跳轉(zhuǎn)不起作用的一項(xiàng)原因就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論