【vue】 vue跳转页面:router-link/this.$router.push()

1、通过标签<router-link>

<router-link to='A'>跳转到A页面</router-link>

  

2、通过方法 this.$router.push()

html

<span @click="routerTo('A')">TO Page A</span>

script

methods: {
    routerTo (val) {
      this.$router.push({path: val})
    }
  }

  

猜你喜欢

转载自www.cnblogs.com/ximiximi-blog/p/11738378.html