Skip to content

Commit

Permalink
feat: 暴露设置鼠标移动方法
Browse files Browse the repository at this point in the history
  • Loading branch information
yue1123 committed Nov 9, 2022
1 parent 83229cd commit 42e7c07
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/components/map/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,17 @@
})
defineExpose({
// 父组件获取map实例方法
getMapInstance: () => map
getMapInstance: () => map,
// 父组件/外部获取map组件 options
getBaseMapOptions: () => props,
// 设置地图是否可拖动
setDragging
})
provide('getMapInstance', () => map)
provide('parentUidGetter', uid)
provide('baseMapSetCenterAndZoom', (_center: { lng: number; lat: number }) => setCenterAndZoom(_center))
provide('baseMapSetDragging', (enableDragging: boolean) => setDragging(enableDragging))
provide('getBaseMapOptions', () => props)
</script>
<script lang="ts">
export default {
Expand Down

0 comments on commit 42e7c07

Please sign in to comment.