Compare commits
No commits in common. "d4d85a1f11f5ff8e17b8b2f1073c1eaef47c1917" and "b64bd050bdf2c03f47dedd8b38cd949604115f2e" have entirely different histories.
d4d85a1f11
...
b64bd050bd
@ -4,8 +4,7 @@
|
||||
<!-- 不能用a标签 -->
|
||||
<!-- <a href="/foo">到foo</a> -->
|
||||
<!-- <router-link to="/foo">到foo</router-link> -->
|
||||
<button @click="tiaozhuan">用js replace 跳转</button>
|
||||
<button @click="back">后退一步</button>
|
||||
<button @click="tiaozhuan">用js跳转</button>
|
||||
<router-link :to="{path:'/foo',query:{name:123,age:234,asda:1411}}">到foo</router-link>
|
||||
</div>
|
||||
</template>
|
||||
@ -14,17 +13,8 @@ export default {
|
||||
methods:{
|
||||
tiaozhuan(){
|
||||
// js this.$router.push
|
||||
// js跳转 (*)
|
||||
// 编程式导航
|
||||
|
||||
this.$router.push({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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user