this.$route.query怎么存
时间: 2023-08-09 22:08:03 浏览: 41
this.$route.query是Vue Router中的一个属性,用于获取URL中的查询参数。你可以通过在URL中添加查询参数来传递数据,然后使用this.$route.query来获取这些参数的值。在你提供的代码中,this.$route.query.xzqid和this.$route.query.name分别用于获取URL中的xzqid和name参数的值。这些值可以在代码中进行存储和使用。
相关问题
this.$route.query.record
根据引用中的代码片段,`this.$route.query.record`表示从当前路由对象`$route`中获取名为`record`的查询参数。引用和提到,`$route`对象的`matched`属性是一个数组,包含了当前路由的所有嵌套路径片段的路由记录。因此,`this.$route.query.record`是从当前路由的查询参数中获取名为`record`的值。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [this.$router和this.$route区别 && 路由传参的2种方式 && this.$route的各种语法](https://blog.csdn.net/monika_beiluqi/article/details/115446349)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
this.$route.query
this.$route.query是Vue Router中的一个属性,用于获取当前路由的查询参数。查询参数是指在URL中以问号“?”开头的键值对,例如:http://example.com/?name=John&age=25,其中name和age就是查询参数。使用this.$route.query可以获取到当前路由的所有查询参数,返回值是一个对象,例如:{name: "John", age: "25"}。