replace 跳转
This commit is contained in:
parent
b64bd050bd
commit
f72a9aa2cb
@ -4,7 +4,7 @@
|
|||||||
<!-- 不能用a标签 -->
|
<!-- 不能用a标签 -->
|
||||||
<!-- <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跳转</button>
|
<button @click="tiaozhuan">用js replace 跳转</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>
|
||||||
@ -13,8 +13,12 @@ export default {
|
|||||||
methods:{
|
methods:{
|
||||||
tiaozhuan(){
|
tiaozhuan(){
|
||||||
// js this.$router.push
|
// js this.$router.push
|
||||||
|
// 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}})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user