1 通过 直接跳转
类似于a标签跳转,例:
<router-link to="index">跳转到首页</router-link>
2 在script里面点击跳转
<p @click="index" >点击这里跳转到首页</p>
methods:{ //跳转页面
index(){
this.$router.push({ path:'/index' })
}
}
新增:
this.$router.forward()//前进
this.$router.back()//后退
this.$router.go()//可前进也可后退