关于使用vue-router跳转页面的问题。

1 当前的页面URL为

http://localhost:8081/#/home/index/home

通过点击当前页面的一个按钮实现页面的跳转,跳转到的页面的URL为

http://localhost:8081/#/home/client/Index

2 我的代码:

this.$router.push(''./home/client/Index)

3 但是点击跳转后页面的URL变为

http://localhost:8081/#/home/index/home/client/Index

路由只是简单地添加到后面了,无法实现跳转。

请问如何使用vue-router进行页面的跳转呢?

阅读 4k
1 个回答

this.$router.push({path:'/home/client/Index'})

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题