Home  >  Article  >  Web Front-end  >  How to obtain this.$router.push parameter in Vue

How to obtain this.$router.push parameter in Vue

小云云
小云云Original
2018-03-01 09:57:033473browse

1.Params

Since dynamic routing also passes params, path cannot be used with params in this.$router.push() method, otherwise params will be invalid. You need to use name to specify the page.

And access through the name attribute of routing configuration

Define parameters in the routing configuration file:

Get the page through name and pass params :

Get parameters through this.$route.params on the target page:

2.Query

The page passes parameters through path and query. In this example, row is a certain row of table data.

Get the parameters on the target page through this.$route.query:

this.$route.query.row.xxx

The above is the detailed content of How to obtain this.$router.push parameter in Vue. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn