<script setup lang='ts'>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
const locationInfo = ref('')
onLoad(options => {
uni.getLocation({
type: 'gcj02',
geocode: true,
success(res) {
locationInfo.value = 'uni.getLocation:' + JSON.stringify(res)
}
})
})
function chooseLocation() {
uni.chooseLocation({
success(res) {
if ( res.errMsg === 'chooseLocation:ok') {
console.log(res)
}
}
})
}
</script>