After migration from rc11 to 1.1.1 my search component stoped working.
Problem
The fetch method in the page is called only for _first_ search.
SearchComponent
<div>
<input type="text" v-model="q" @keyup.enter="doSearch" />
<button type="button" @click.prevent="doSearch">Search</button>
</div>
``js
methods: {
doSearch () {
console.log('doSearch')
this.$router.push(/search/0?s=${encodeURIComponent(this.q)}`)
}
}
}
`SearchPage`
```js
validate ({ store, params }) {
console.log('validate')
return true
},
fetch ({ store, params, error, query }) {
console.log('fetch')
return store.dispatch(action, { search: query.s })
.catch(function (reason) {
error({statusCode: 500, message: reason})
})
},
When I do first search everything is ok. I get on console:
validate
fetch
But when I do Search again (change search text and hit enter) I only get:
validate
After research I think this is the same problem as:
https://github.com/nuxt/nuxt.js/issues/2519
But I did't find the solution yet.
FIX!
I added to the page
export default {
watchQuery: ['s'],
[...]
}
and it started to work again! 馃憤
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.
Most helpful comment
FIX!
I added to the page
and it started to work again! 馃憤