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

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

小云云
Release: 2018-03-01 09:57:03
Original
3579 people have browsed it

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template