let item = store.state.news.find(function(item) {
return item.username === params.id
});
return item ? true : false;
validate ({ params, store }) {
// Check if `params.id` is an existing category
store.state.news.forEach(function(item) {
if (item.username === params.id) {
return true
}
});
}
nuxtServerInit ({ commit }, { req }) {
let { data } = await axios.get('https://jsonplaceholder.typicode.com/users')
commit('setNews', data)
}
<page-header/>
<PageHeader/>
мне вот такая штука на ум пришла
https://codepen.io/speedblizzz/pen/XWrRgRa