0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Vue Routerでparamsとqueryの取得方法

Posted at

#Vue Routerでparamsとqueryの取得方法

##params

https//localkhost:3000/users/1
→ this.$route.params.id

##query(クエリ)

localhost:8080/example?itemId=1234
→ this.$route.query.itemId

「?」+「変数名」=「変数の値」がqueryパラメータとなる
この例では「itemId」が変数名、「1234」が変数の値となる

queryパラメータ内に「?」を複数付けた場合、正しい動きをしない可能性があるので注意

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?