Cannot read property'$Message' of undefined

use the iview component Message
to make a login request using axios, and display the error message according to the returned status code

  this.$axios.post("http://wx.simplesay.xin/user/login", {
    email: this.formLogin["email"],
    password: this.formLogin["password"]
  }).then(function (response) {
    if (response.data.code === 10001) {
      this.$Message.info("")
    } else {
      console.log(response.data)
    }
  })
  

but this will cause an error
if I create a method

ok () {
  this.$Message.info("Clicked ok")
},

if you use it in a Model component, you will not report an error. What is the reason?
< Modal

    v-model="model_login"
    title="Common Modal dialog box title"
    :closable="false"
    :mask-closable="false"
    @on-ok="ok"
    @on-cancel="cancel">
Aug.20,2021

ordinary functions and arrow functions learn


context problem, change it to the following

this.$axios.post('http://wx.simplesay.xin/user/login', {
    email: this.formLogin['email'],
    password: this.formLogin['password']
  }).then((response) => {
    if (response.data.code === 10001) {
      this.$Message.info('')
    } else {
      console.log(response.data)
    }
  })
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-1b37d89-2c0d2.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-1b37d89-2c0d2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?