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

How to pass parameters in vue routing

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "how to transmit parameters in vue routing". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "vue routing how to transmit parameters" bar!

The specific methods are as follows:

1. Transfer parameters by routing through params

Use the name in the route attributes to match the route, passing parameters through params, but the page refresh data is lost.

Methods: {

Insurance (id) {

This.$router.push ({

Name: 'particulars'

Params: {

Id: id

}

})

}

two。 Transfer parameters by routing through query

Use path to match the route, passing parameters through query.

Methods: {

Insurance (id) {

This.$router.push ({

Path:'/ particulars'

Query: {

Id: id

}

})

}

3. Call $router.push to transfer parameters by route

Directly call $router.push to carry the jump of parameters, and the page refresh data will not be lost.

Methods: {

Insurance (id) {

This.$router.push ({

Path: `/ particulars/$ {id}`

})

}

At this point, I believe you have a deeper understanding of "how to transmit parameters in vue routing". 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