// push参数为字符串
this.$router.push('/hello')
// 参数为对象
this.$router.push({
path: '/hello' })
// 对象中有query属性,相当于发送了一次get请求,请求参数会显示在浏览器地址栏中
this
Vue中this.$router.push(参数) 实现页面跳转
最新推荐文章于 2023-12-22 10:31:38 发布
本文介绍了在Vue.js应用中如何利用this.$router.push进行页面跳转,特别是强调在处理动态路由时,若要传递params,应避免与path同时使用,而是通过指定路由的name属性进行跳转。
摘要由CSDN通过智能技术生成