代码如下:
<button @click='prev'>返回上一级</button>
<script>
methods:{
prev(){
this.$router.go(-1)
}
}
</script>
注:后退:this.router.go(−1),反之前进就是this.router.go(-1), 反之前进就是this.router.go(−1),反之前进就是this.router.go(1)
代码如下:
<button @click='prev'>返回上一级</button>
<script>
methods:{
prev(){
this.$router.go(-1)
}
}
</script>
注:后退:this.router.go(−1),反之前进就是this.router.go(-1), 反之前进就是this.router.go(−1),反之前进就是this.router.go(1)