鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ vuer中,路由跳轉(zhuǎn)問題

vuer中,路由跳轉(zhuǎn)問題

使用vue-router,以下url可以正常定位到我的頁面:

http://localhost:8080/#/contactIndex

但是,在彈窗組件中的成功回調(diào)函數(shù)中,因為用不了vue-router,我使用以下url:

  window.location.href = '/contactIndex'

不能正常跳轉(zhuǎn)到上面的這個頁面,請問如何修改能夠正常跳轉(zhuǎn)到上面的頁面?

回答
編輯回答
孤酒

不能使用路由的跳轉(zhuǎn)函數(shù)嗎

this.$router.push({path:'/contactIndex'})

不行的話

window.location.hash = "#/contactIndex"
2017年5月4日 18:46
編輯回答
萢萢糖

可以寫個絕對鏈接:

window.location.href = 'http:xxx.html/contactIndex'
2017年11月21日 19:50