Can computed be used in combination with axios? How should I use it? the data obtained by my return axios is always undefined.

detail: {
    get() {
      let detail
      const gameId = this.id
      querySingleGameDetail(gameId).then(response => {
        detail= response.data.data.detail//
      })
      return detail
    }
}
Feb.28,2021

detail: {
    get() {
        let detail
        const gameId = this.id
        querySingleGameDetail(gameId).then(response => {
        detail= response.data.data.detail
        return detail
        })
    }
}

replied to you in the comments under another question.
normally, you can use async and await to convert asynchronous requests into Synchronize

// 
async get () {
    var result = await getDetails(this.param)
    return result
}

but it seems to be forbidden to use this thing in computed, so you can't get the correct value of return, so use watch instead.

< hr >

found some instructions in eslint-plugin-vue

Computed properties should be synchronous ( calculation property needs to be of Synchronize. Asynchronous actions inside them may not work as expected and can lead to an unexpected behaviour, that's why you should avoid them. If you need async computed properties you might want to consider using additional plugin vue-async-computed
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bd86c5-4568b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bd86c5-4568b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?