2017-01-10 52 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制作,因此破坏它。