vue跳转的两种方法

1 标签跳转

 

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

点击事件跳转

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

 

 

猜你喜欢

转载自www.cnblogs.com/lidonglin/p/9836728.html
今日推荐