vue中页面跳转的方式有哪些
在vue中实现页面跳转的方式有:1.使用a标签跳转;2.使用this.$router.push()函数跳转;3.使用router-link标签跳转;
在vue中实现页面跳转的方式有以下几种
1.使用a标签跳转
<ahref="https://www.baidu.com"><button>点击跳转</button></a>
2.使用this.$router.push()函数跳转
<template><divid='test'>
<button@click='goTo()'>点击跳转</button>
</div>
</template>
<script>
exportdefault{
name:'test',
methods:{
goTo(){
this.$router.push('/testDemo');
3.使用router-link标签跳转
<router-link:to="{path:'testDemo',query:{setid:123456}}"><button>点击跳转</button>
</router-link>
版权声明
本文仅代表作者观点,不代表米安网络立场。
上一篇:phpnow 卸载干净的方法有哪些 下一篇:win11加密文件夹无法勾选如何解决
发表评论:
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。