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>
methods: {
doSearch () {
console.log('doSearch')
this.$router.push(`/search/0?s=${encodeURIComponent(this.q)}`)
}
}
}
SearchPage
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:
doSearch
validate
fetch
But when I do Search again (change search text and hit enter) I only get:
doSearch
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.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2277">#c2277</a>)</em></sub></div>