In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
这篇文章主要讲解了"Vue中如何动态设置路由参数",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Vue中如何动态设置路由参数"吧!
1.使用this.$router.go(),与js histroy.go() 用法一直,前进1,后退-1,当前页面:0
注意 使用go时 必须是已经有访问历史记录了
案例:
后退 前进 刷新当前 export default { methods: { goht(){ this.$router.go(-1); }, goqj(){ this.$router.go(1); }, gosx(){ this.$router.go(0); //或者 this.$router.go(); } } }
2.使用push调用:
案例
去A页面 去B页面 exprot default { methods: { pageA(){ //去路由A页面,字符串形式只能是path,类似to="path" this.$router.push('/RouterA'); }, pageB(){ //去路由B页面,数组形式,类似 :to="{}" this.$router.push( { name: 'RouterB', query: {'name': 'name1', title: 'title1'} //,params:{'name': 'name2', title: 'title2'} } ); } } }感谢各位的阅读,以上就是"Vue中如何动态设置路由参数"的内容了,经过本文的学习后,相信大家对Vue中如何动态设置路由参数这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.