Home

Issue: 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

[issue link]

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)
        })
}
This question is available on Nuxt.js community (#c2630)