Static GitHub Issues

[3035] How to refresh the nuxt page? If the page is refreshed with location.reload (), the page looks like the beauty center rendering asyncData does not appear to be executed

prev: How to set meta robots tag?
next: Core nuxt class should not have side effects on creation

image

For example, I want to let the page refresh, but the page is blank, and the data must be refreshed by hand.

    asyncData ({ params, error }) {
      return axios.get('http://localhost:3333/api/newslist')
      .then((res) => {
        return { datas: res.data }
      }).catch (err => {
          console.log('报错了啊')
      })
    },
    methods: {
      deletFn(id) {
        axios.get('http://localhost:3333/api/newsdelet/' + id)
        .then((res) => {
          alert('The article is deleted successfully!')
          location.reload()
        }).catch (err => {
            console.log('报错了啊', err)
        })
}
<!--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/c2630">#c2630</a>)</em></sub></div>