<template>
  <view>
    <button @click="getAddress">获取定位</button>
  </view>
</template>

<script setup>
const getAddress = () => {
  uni.chooseLocation({
    success: (res) => {
      location.value = {
        name: res.name,
        address: res.address,
        latitude: res.latitude,
        longitude: res.longitude
      };
    }
  });
};

</script>

