在Vue中实现页面跳转的方式有:1.使用a标签跳转;2.使用this.$router.push()函数跳转;3.使用router-link标签跳转;在vue中实现页面跳转的方式有以下几种使用a标签跳转<a href=&quo
在Vue中实现页面跳转的方式有:1.使用a标签跳转;2.使用this.$router.push()函数跳转;3.使用router-link标签跳转;
在vue中实现页面跳转的方式有以下几种
使用a标签跳转
<a href="https://www.baidu.com"><button>点击跳转</button></a>
使用this.$router.push()函数跳转
<template> <div id='test'>
<button @click='GoTo()'>点击跳转</button>
</div>
</template>
<script>
export default{
name:'test',
methods:{
goTo(){
this.$router.push('/testDemo');
使用router-link标签跳转
<router-link :to="{path:'testDemo',query:{setid:123456}}"> <button>点击跳转</button>
</router-link>
--结束END--
本文标题: vue中页面跳转的方式有哪些
本文链接: https://www.lsjlt.com/news/111709.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0