vue router路由跳转

Quange.vue

<template>
  <div id="Quange">
    <p>{{msg}}</p>
    <button type="button" @click="onClick">跳转</button>
  </div>
</template>

<script>
  export default {
    name: 'Quange',
    data() {
      return {
        msg: 'hello quange!'
      }
    },
    methods: {
      onClick() {
        // 页面内跳转
        // this.$router.push('/Furong');
        this.$router.replace('/Furong');
        console.log('onClick');
      }
    }
  }
</script>

<style>
  #Quange {
    color: red;
  }
</style>
posted @ 2021-07-08 14:35  thomas_blog  阅读(51)  评论(0编辑  收藏  举报