The axios callback method failed, but it was successful to write the method into the callback

export default {

mounted() {
let para = {
  offset: 0,
  limit: 50000,
  exchangeNo: ""
};
var _this = this;
let commodityCode = [];
axios.post("/api/zd/futures/list", para)
  .then(function(response) {
    _this.total = response.data.total;
    for (var i = 0; i < response.data.rows.length; iPP) {
      commodityCode.push(response.data.rows[i].code)
    }
   _this.initlocalStore(_this.commodityCode)//localstorelocalstore

    _this.websocketsend(`shzd@1@${_this.storage.commodityCodeList}`) //websocket this.websock.send(agentData);
  })
  .catch(function(error) {
    console.log(error);
  });

}

Jun.16,2021

scope problem. This points to an error, not to what you think of vm, but to window, so you can't find initlocalStore

.

you can use the _ this or arrow function you defined above

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-1ea562f-47b27.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-1ea562f-47b27.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?