Skip to content

fpi-map-location地图经纬度选择

TIP

当前组件在 element-plus-expand

<template>
    <fpi-map-location
        v-model="form.position"
        :to-fixed-num="8"
        @get-address="getAddress"
    />
</template>

<script setup lang="ts">
import { reactive, toRefs } from 'vue'
const state = reactive({
    form: {
        // position: [120.172332, 30.175451], // 纬度 经度
        position: [], // 纬度 经度
        address: ''
    }
})
/**
 * 获取点击地图的位置
 * @param address
 */
function getAddress(address: any) {
    state.form.address = address
}
const { form } = toRefs(state)
</script>
显示代码

属性

参数说明类型可选值默认值
toFixedNum经纬度位数修约,这样也会影响手动输入的位数number-6
title弹框标题string-请在地图上单击选择坐标点
style弹框样式object-{}
v-model经纬度的值用于回显number[]-[120.193938105986, 30.190082529340692]

事件

事件名说明参数
getAddress选择地图点位后,向外发送的事件。当前选则的位置地址

插槽

插槽名说明
img自定义经纬度输入框旁的图标

fpi-component