How is it that the properties under vue this can't be passed?

* map.js
import AMap from "AMap"
export function add (map, overlayers) {

console.log(map)
map.add(overlayers)

}

* xxx.vue
the add function in map.js is introduced here
import {mapInit, addMarker, setLabel, add} from "common/js/map"

if I assign the map instance to the this.map2 side, the output map of the add function is undefind
this.map2 = mapInit (document.getElementById ("mapcontent2"));
this.map2.on) (" click", function (e) {

)
          marker = addMarker({
              position:[e.lnglat.getLng(),e.lnglat.getLat()],draggable:true,cursor:"move"});
              add(this.map2,[marker])
      });

if you assign a value to the output map of the add function on the other side of the let map1,map2;, you can

what is the problem?
I also hope that people with knowledge of the matter will teach me about love!

clipboard.png

Mar.21,2021

the callback function you use element.on ('click',callback) . The this in
callback does not point to a Vue instance. You can use that.map2 at the beginning of the dialogShow method const that=this .

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