Vue在JS中如何进行路由跳转

1、在需要跳转的地方执行下面代码即可,其中 '/path' 为路由中配置的 path 值:

// this.$router.push('/about')
export default {
  methods: {
    //this.$router.push('/aaa')
    onClickLeft() {
       this.$router.push('/');
    }
  }
};

猜你喜欢

转载自www.cnblogs.com/zhousjcn/p/12791918.html