Nuxt.js: asyncData with router query in next tag call only once even query changed

Created on 8 Jan 2018  路  6Comments  路  Source: nuxt/nuxt.js

I try nuxt with next tag and found out that asyncData triggered only once. It's won't work when navigate with nuxt-link and $router.replace etc.

/page?catagory=foo => /page?catagory=bar is not working

The only way to get it works it work is to use watch: $route

This question is available on Nuxt.js community (#c2188)

Most helpful comment

for those who haven't found the solution - in 1.1.1 you just have to define your query params to watch in page component:
watchQuery: ['service'.'page']

All 6 comments

I have some problem with nuxt 1.0.0

Seems like fetch no longer fires on route change and only on component load. Not sure if the former was a bug or not.

As a workaround maybe you can use computed propeties as a proxy

for those who haven't found the solution - in 1.1.1 you just have to define your query params to watch in page component:
watchQuery: ['service'.'page']

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings