getAddress() {
let that = this;
alert("geolocation" in navigator)
if (navigator.geolocation) {
alert('浏览器支持')
navigator.geolocation.getCurrentPosition(function (position) {
that.unitName = `经纬${position.coords.latitude}//${position.coords.longitude}`
});
} else {
alert('浏览器不支持')
}
},
这是我获取用户地理位置的函数,在PC端是正常的,在手机端的各种浏览器里面,都弹出了true和浏览器支持,但是赋值这里就不行,大佬们知道是怎么回事吗?