Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of vue route jump?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

The main content of this article is to explain "what is the method of vue routing jump", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "what is the method of vue routing jump"!

Jump mode: 1. Use "

When parsing, the browser parses it into a similar to

< a >

The label.

# div and css style Click to verify Animation effect

Don't forget to introduce the paths that need to jump in router/index.js ahead of time.

2. This.$router.push ({path:'/user'})

It is often used to route parameters, and its usage is the same as the third one.

Difference:

1), query introduction method

Params can only use name to introduce routing

And query will be introduced with path.

2), query delivery mode

Similar to the parameters passed by get in our ajax, the parameters are displayed in the browser address bar

Params is similar to post in that it does not display parameters in the browser address bar

In the helloworld.vue file

. Verify that routing parameters export default {data () {return {id:43, / / parameters to be passed}}, methods: {change () {this.$router.push ({/ / core statement path:'/select', / / path to jump query: {/ / push and query are used together when routing parameters are passed Pass the parameter id:this.id,}})} when acting

In the select.vue file

Chengdu Beijing export default {data () {return {id:'',}}, created () {/ / receive parameter this.id = this.$route.query.id in life cycle, / / accept parameter key code console.log (this.id)}}

3. This.$router.replace {path:'/'} is similar, so I won't repeat it any more.

At this point, I believe you have a deeper understanding of "what is the method of vue routing jump?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report