In the vue project, I push an array in methods, but I can't find its length and the value that push enters.

in the vue project, I lost the latitude and longitude of Gaud"s api to Baidu in the methods method

AMap.convertFrom(this.list[i].lnglats, "baidu", function(meg, res) {
              let _lnglats = [res.locations[0].lng, res.locations[0].lat]
              // 
              this.transformLnglats.push(_lnglats)
              console.log(this.transformLnglats)
              console.log(this.transformLnglats[0])
}.bind(this))

if you agree in it, you can access the length and contents of the array.

clipboard.png


clipboard.png

but I can"t find the length and array inside. Why? The only difference of
is the one I marked red. What"s the difference between the two?

Mar.20,2021

I think there is something wrong with your this. The this may still be vue when it is introduced, but the later one may not be the same. It is recommended to try var _ this = this; first

.

in addition, your assignment is performed in a callback function, and you may not have completed the assignment outside.

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