I get server data use asyncData or fetch method, but when i refresh my page, the data will lose, i feel fetch data by mounted callback is not awesome, but i don't know how to deal with this ?
asyncData ({app}) {
return app.$axios.$get(`/list`)
.then((res) => {
if (res.status === 200) {
return { files_list: res.data.data }
} else {
console.error(res.msg)
}
})
.catch((e) => {
console.error(e)
})
},
any suggest very thanks .
<!--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/c1711">#c1711</a>)</em></sub></div>