首页 > 技术文章 > vue使用路由跳转到上一页

luguankun 2019-04-06 17:18 原文

this.$router.go(-1)

 

<template>
<div>
    <button class="btn btn-success" @click="goback()">返回上一页</button>
</div>
</template>
<script>
export default {
  name: "GoBack",
  data () {
    return {
    };
  },
  methods:{
      goback(){
          this.$router.go(-1)
      }
  }
}
</script>
<style lang="css" scoped>
</style>

 

推荐阅读