In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "what are the differences between query and params in vue", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "what is the difference between query and params in vue".
Differences: 1. Query writes the parameter address with path, while params uses name to write the parameter address; 2, the parameter does not disappear when query refreshes the page, but it disappears when params refreshes the page; 3. The parameter passed by query will be displayed in the url address bar, while the parameter passed by params will not be displayed in the address bar.
This article operating environment: windows10 system, Vue2.9.6 version, DELL G3 computer.
What is the difference between query and params in vue
Query syntax:
This.$router.push ({path: "address", query: {id: "123"}}); this is the pass parameter this.$route.query.id;, this is the accept parameter
Params syntax:
This.$router.push ({name: "address", params: {id: "123"}}); this is the pass parameter this.$route.params.id;, this is the accept parameter
Difference:
1. First of all, it is written differently. Query is written using path to write the parameter address, while params is written using name to write the parameter address. You can take a look at the relevant attributes when you write the route, or you can output the routing object information to take a look.
two。 The receiving method is different, one is received by query, the other is received by params. The summary is that who sends it and who receives it.
The parameters will not disappear when 3.query refreshes the page, but when params refreshes the page, the parameters will disappear. You can consider the local storage solution.
The parameters passed by 4.query are displayed in the url address bar, while the parameters passed by params are not displayed in the address bar.
The above is about the content of this article on "what is the difference between query and params in vue?" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
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.