I am in pages/index.vue and for show news in my page, i use asyncdata method but when i goto an other page and come back to home news data are empty. Should i save data on store? Or have other solution for this?
<template>
<div>
{{news.length}}
<nuxt-link to="/about"> about </nuxt-link>
</div>
</template>
<script>
async asyncData({$axios}){
return $axios.post("/news")
.then(({data : {data : news}}) => {
return {news};
})
.catch(err => console.log(err));
}
</script>