2017-01-10 86 views
0

我現在有一個非常簡單的頁面,現在我只是爲將來的開發做準備,但現在我的網址不斷變化,現在暫停。爲什麼我的url不斷被vue.js路由改變?

import shipmentInformation from './shipment-information.vue'; 

Vue.use(VueRouter); 

let router = new VueRouter({ 
    base: '/QuickQuote/QuickQuoteRefactor/', 
    routes: [ 
     { name: 'shipmentInformation', path: '/', component: shipmentInformation } 
    ] 
}); 

new Vue({ 
    router 
}).$mount('#quickQuoteApp') 

這是#quickQuoteApp包含<router-view>元素的網頁上運行。用戶通過導航到(在本地計算機上)localhost/QuickQuote/QuickQuoteRefactor來到此頁面。組件加載和我看到哈希得到添加到一秒鐘(localhost/QuickQuote/QuickQuoteRefactor#)的URL的末尾之前,它由於某種原因更改爲localhost/#/

關於爲什麼會發生這種情況的任何想法。我認爲'基礎'選項應該考慮到這一點。

回答

1

,我發現這是由VUE路由器之間的衝突引起的,jquery.history.js

不知道確切原因,但它看起來像歷史試圖「糾正」在URL中的哈希值發生變化由vue-router製作,因此破壞它。

相關問題