更新
This commit is contained in:
@@ -28,6 +28,16 @@ const instance = defineStore('user', {
|
||||
actions: {
|
||||
getPosition() {
|
||||
this.position = { latitude: 36.636753, longitude: 119.11914 }
|
||||
|
||||
if (navigator?.geolocation?.getCurrentPosition) {
|
||||
console.log('存在原生定位')
|
||||
navigator.geolocation.getCurrentPosition(position => {
|
||||
console.log('原生定位', position)
|
||||
})
|
||||
} else {
|
||||
console.log('原生定位不可用')
|
||||
}
|
||||
|
||||
// return
|
||||
initAMap().then(() => {
|
||||
// console.log(3)
|
||||
|
||||
Reference in New Issue
Block a user