<script setup lang="ts">
import FsMapPicker from '@/components/FsMapPicker/index.vue'

const showPicker = ref(false)

const mapData = ref({ lng: '', lat: '', name: '', address: '' })

const openPicker = () => {
  showPicker.value = true
}

/* 选择完毕 */
const mapPickerDone = (data: any) => {
  mapData.value = data
}
</script>

<template>
  <div>
    <div>
      <p>经度：{{ mapData.lng }}</p>
      <p>纬度：{{ mapData.lat }}</p>
      <p>地址：{{ mapData.name }}</p>
      <p>详细信息：{{ mapData.address }}</p>
    </div>
    <el-button type="primary" @click="openPicker">打开地图选择</el-button>
    <FsMapPicker v-model="showPicker" map-key="" @done="mapPickerDone" />
  </div>
</template>

<style scoped lang="scss"></style>
