码迷,mamicode.com
首页 > 其他好文 > 详细

vue 页面跳转的两种方式

时间:2018-12-07 20:57:15      阅读:476      评论:0      收藏:0      [点我收藏+]

标签:targe   tps   lin   str   tar   link   com   get   页面   

1,标签跳转

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

2,点击事件跳转

   html :

      <button @click="hreftwo" class="test-one">点我到第二个页面</button>
   js :

      methods:{ //跳转页面

                    hreftwo(){

                              this.$router.push({ path:‘/two‘  })

                                }

                       }

3,如果你要的只是点击跳转返回上一页,请看我另一篇博文

       链接:https://www.cnblogs.com/lgnblog/p/9957661.html

                                                                                                                                                                                                                                                                                         

vue 页面跳转的两种方式

标签:targe   tps   lin   str   tar   link   com   get   页面   

原文地址:https://www.cnblogs.com/lgnblog/p/10084121.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!