The problem of using axios under vue

beginners, chrome appears

when using axios to process return values
TypeError: Cannot set property "menu" of undefined

error, I don"t know why. The
menu variable I have defined in data.
use mockjs to intercept.
axios part of the code is as follows
clipboard.png
response.data.menuconsole
axiosmenu2this.menu
clipboard.png
menu2mockjs
chromeconsole:
clipboard.png

clipboard.png
I don"t know why

Mar.10,2021

then(function(response){
    this.menu =....
})
Change

to

then(response => {
    this.menu =....
})

returns a string, and the return type needs to be specified as json

Menu