router 跳转页面

 vue页面跳转:

1、标签跳转:

 <router-link to='two.html'><button>点我到第二个页面</button></router-link>

 2、html点击事件跳转:

  html :
 <button @click="hreftwo" class="test-one">点我到第二个页面</button>
   
  js :
      methods:{ //跳转页面
         hreftwo(){
              this.$router.push({ 
path:'/two.html'
}) } }

实际Vue项目:

//  第一种 无参数
  this.$router.replace({
        path: "/index"
 });
  // 第二种 有参数
  this.$router.replace({
        path: "/authorize/authorizeResult",
        query: {
            isSuccess: "0" //0表示失败
         }
   });

   

 // 第三种 无参数,(可返回)this.$router.push({
      path: "/Givingout/GivingoutRecord"
 });
未完,待续......
原文地址:https://www.cnblogs.com/zhishiyv/p/12054526.html