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]例如执行删除文章,我想让页面刷新一下,但是页面出现空白,必须手动刷新才会出数据
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('文章删除成功!')
location.reload()
}).catch (err => {
console.log('报错了啊', err)
})
}