(1).一种是重定向跳转,超连就是一种重定向跳转,这样的跳转request对象是传不到下一个页面的,下一个页面得到的request对象是一个新的对象,而不是上一个页面传过来的就得不到上一个页面的数据.如果你想通过这种方法跳转的话,那就要用,在下一个页面。
vue传flag给另一个页面有以下两种方法。
1、A页面利用:this.$router.push({path:`/theme/${this.data}`})获得你想要的数据利用桥梁(路由地址):{path:'/theme/:id',name:'theme',component:ThemeEdit}B页面可以通过:$route.params.id获取数据。
2、A页面利用:this.$router.push({name:'themeedit',params:{id:this.data}})利用桥梁(路由地址):{path:'/theme/themeedit',name:'themeedit',component:ThemeEdit}B页面数据获取方式和上面相同此时页面路由地址固定为:http://localhost:8080/#/theme/themeedit。
location.search可以拿到?xxx=xxx的内容,看你想要什么参数了,具体在console.log里面输出location的方法。
然后在created或这mounted里面检测location的变化做成相应的变化即可。