Static GitHub Issues

[1916] When should i fetch server data .

prev: Error: [vuex] Do not mutate vuex store state outside mutation handlers
next: Loading child page directly in the browser

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>