In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the relevant knowledge of "how to achieve page jump in vue". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
This article operating environment: windows7 system, vue2.9.6 version, DELL G3 computer.
How does vue achieve page redirection? How to jump to a new page in a vue project
To document how to jump to a new page in a vue project (a relatively simple and basic question), there are two ways:
1. Tag to open a new window.
The official document says that the v-link directive is replaced by a component directive and does not support the target= "_ blank" attribute. If you need to open a new window, you must use a tag, but in fact, the vue2 version supports the target= "_ blank" attribute (tag= "a"), as follows:
New page opens the home page
2. Programmatic navigation
There are times when you need to jump the page in a click event or in a function, then you can use the example method of router to do so by writing code.
We usually use $router.push and $router.go, but after vue2.0, this method does not support the properties of opening new windows. At this time, you need to use this.$router.resolve, as follows:
SeeShare () {let routeUrl = this.$router.resolve ({path: "/ share", query: {id:96}}); / let routeUrl = this.$router.resolve (`/ share/$ {96}`) window.open (routeUrl.href,'_ blank');} this is the end of the content of "vue how to jump to the page". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.