在vue中实现页面跳转的方式有:1.使用a标签跳转;2.使用this.$router.push()函数跳转;3.使用router-link标签跳转;
在vue中实现页面跳转的方式有以下几种
1.使用a标签跳转
<a href="https://www.baidu.com"><button>点击跳转</button></a>
2.使用this.$router.push()函数跳转
<template> <div id='test'>
<button @click='goTo()'>点击跳转</button>
</div>
</template>
<script>
export default{
name:'test',
methods:{
goTo(){
this.$router.push('/testDemo');
3.使用router-link标签跳转
<router-link :to="{path:'testDemo',query:{setid:123456}}"> <button>点击跳转</button>
</router-link>
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:vue页面跳转方式有哪几种