点我到第二个页面 js :" />

vue 页面跳转的两种方式

来源:博客园 分类: 文章浏览史 发布时间:2021-09-12 11:37:12 最后更新:2021-09-12 浏览:1663
转载声明:
本文为摘录自“博客园”,版权归原作者所有。
温馨提示:
为了更好的体验,请点击原文链接进行浏览
摘录时间:
2021-09-12 11:37:12

1,标签跳转

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

2,点击事件跳转

   html :

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

      methods:{ //跳转页面

                    hreftwo(){

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

                                }

                       }

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

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

                                                                                                                                                                                                                                                                                         

php技术微信