The watchParam property
Watch param change and execute component methods on change (asyncData, fetch(context))
-
Type:
Boolean(default:undefined)
Use the watchParam key to set up a watcher for route params. If the params change, asyncData and fetch(context) will be called. Watching is enabled by default.
If you want to disable watching for params, set watchParam: false.
export default {
watchParam: false
}
By default
nuxt.js reset page component data state after route param change, you can use watchParam: false to disable this behaviour.Warning: The new
fetch hook introduced in 2.12 is not affected by watchParam. For more information see listening to query string changes for params is the same.
Edit this page on GitHub
Updated at Mon, Feb 28, 2022
Leoš Literák
Trizotti
Clément Ollivier
Sébastien Chopin
Marcello Bachechi
Rodolphe
Thomas Underwood
Shek Evgeniy
felipesuri
Lukasz Formela
Hugo Torzuoli
Sylvain Marroufin
Kareem Dabbeet
tramplay
Daniel Roe
verebelyicsaba
Adam
Nate Butler
Sandra Rodgers
Arpit Patidar
Matthew Kuehn
Steven DUBOIS
Travis Lindsey
syagawa
Maxime
かる
Al Power
Florent Delerue
quanghm
José Manuel Casani Guerra
Unai Mengual
kazuya kawaguchi
Michael Lynch
Tomachi
pooya parsa
Meir Roth
Brett
Adam Miedema
Thomas Bnt
Kazuki Furukawa
Anthony Ruelle
Christophe Carvalho Vilas-Boas
Roman Harmyder