mirror of
https://github.com/yudaocode/yudao-ui-admin-vue3.git
synced 2026-05-02 21:58:24 +00:00
!852 bugfix-Map地图组件bug修复
Merge pull request !852 from 不存在的二次猿/bugfux-component-Map
This commit is contained in:
@@ -71,6 +71,16 @@ const props = defineProps({
|
|||||||
center: propTypes.string.def('')
|
center: propTypes.string.def('')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.center,
|
||||||
|
(newVal, oldVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
// 当 center 变化时 重新加载mark点
|
||||||
|
regeoCode(newVal)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
/** 加载百度地图 */
|
/** 加载百度地图 */
|
||||||
const loadMap = () => {
|
const loadMap = () => {
|
||||||
state.address = ''
|
state.address = ''
|
||||||
@@ -101,11 +111,6 @@ const loadMap = () => {
|
|||||||
regeoCode(state.lonLat)
|
regeoCode(state.lonLat)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO @super:这里加一行注释
|
|
||||||
if (props.center) {
|
|
||||||
regeoCode(props.center)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,8 +160,8 @@ const autoSearch = (queryValue: string) => {
|
|||||||
state.loading = false
|
state.loading = false
|
||||||
const temp: any[] = []
|
const temp: any[] = []
|
||||||
|
|
||||||
if (results && results.getPoi) {
|
if (results && results._pois) {
|
||||||
const pois = results.getPoi()
|
const pois = results._pois
|
||||||
pois.forEach((p: any) => {
|
pois.forEach((p: any) => {
|
||||||
const point = p.point
|
const point = p.point
|
||||||
if (point && point.lng && point.lat) {
|
if (point && point.lng && point.lat) {
|
||||||
|
|||||||
Reference in New Issue
Block a user