Cannot set property 'pageData' of undefined?

clipboard.png


pageData

clipboard.png

Jul.18,2021

this problem. Your function is not = > arrow function. The this obtained is not a vue instance. Change
to

.
 axios.get('/api/tableData.json')
        .then(response => {
            console.log(111)
            response=response.data
            console.log(response.pageData)
            if(response.ret && response.pageData) {
              var data = response.pageData
              this.pageData = data
            }
    })

it's either like what the second floor said.
either before axios.get ('/ api/tableData.json')
, let _ this = this;

 _this this
Menu