This commit is contained in:
theluyuan 2021-07-06 17:00:01 +08:00
parent f72a9aa2cb
commit d4d85a1f11

View File

@ -5,6 +5,7 @@
<!-- <a href="/foo">到foo</a> --> <!-- <a href="/foo">到foo</a> -->
<!-- <router-link to="/foo">到foo</router-link> --> <!-- <router-link to="/foo">到foo</router-link> -->
<button @click="tiaozhuan">用js replace 跳转</button> <button @click="tiaozhuan">用js replace 跳转</button>
<button @click="back">后退一步</button>
<router-link :to="{path:'/foo',query:{name:123,age:234,asda:1411}}">到foo</router-link> <router-link :to="{path:'/foo',query:{name:123,age:234,asda:1411}}">到foo</router-link>
</div> </div>
</template> </template>
@ -15,10 +16,15 @@ export default {
// js this.$router.push // js this.$router.push
// js (*) // js (*)
// //
// this.$router.push({path:'/foo',query:{name:123,age:234,asda:1411}}) this.$router.push({path:'/foo',query:{name:123,age:234,asda:1411}})
// 退 // 退
// //
this.$router.replace({path:'/foo',query:{name:123,age:234,asda:1411}}) // this.$router.replace({path:'/foo',query:{name:123,age:234,asda:1411}})
},
back(){
// 退 退
// 退
this.$router.go(99999);
} }
} }
} }