This article mainly explains the vue router-link parameter passing and parameter usage examples in detail. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let's follow the editor and take a look. I hope it can help you master the router-link parameter transfer and the use of parameters in vue.
1. Path: http://localhost:8081/#/test?name=1
<router-link :to="{path:'/test',query: {name: id}}">
Jump(id is a parameter)
Use: this.$route.query.id
2. Path: http://localhost:8081/#/test/1
<router-link :to="'/test/'+id">
Jump router-link>(id is a parameter)
Route:
##Use: this.$route.params.id(This id is given to Related to the configuration of the map route) this.$route is an array, which contains all the information of the routeNote: If the link in router-link starts with '/', it starts from the root route , if it does not start with '/', it starts from the current route. Related recommendations:vue router uses jquery and params to pass parameter analysis
detailed explanation of js anonymous function usage and parameter passing examples
How to understand types, parameters and execution environments in JavaScript
The above is the detailed content of Detailed explanation of router-link parameter passing and use of parameters in vue. For more information, please follow other related articles on the PHP Chinese website!