Skip to content

Commit

Permalink
feat: add component name
Browse files Browse the repository at this point in the history
  • Loading branch information
yue1123 committed Sep 26, 2022
1 parent 872e022 commit cf88695
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
style="background: #f1f1f1; position: relative; overflow: hidden"
>
<slot name="loading" v-bind:loading="!initd">
<div
style="
color: #999;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
"
>
<div style="color: #999; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)">
{{ !initd ? 'map loading...' : '' }}
</div>
</slot>
Expand All @@ -23,7 +15,6 @@
</template>

<script setup lang="ts">
// FIXME: props 属性名字统一, 去掉enable
import {
inject,
defineProps,
Expand All @@ -40,7 +31,7 @@
import bindEvents, { Callback } from '../../utils/bindEvents'
export interface BaiduMapProps {
ak?: string
ak: string
/**
* 地图显示宽度
*/
Expand Down Expand Up @@ -226,6 +217,7 @@
'longpress'
])
const ak = props.ak || inject('baiduMapAk')
if (!ak) console.warn('missing required props: ak')
// 获取地图SDK Script
function getMapScriptAsync() {
if (!window._BMap) {
Expand All @@ -243,7 +235,7 @@
document.body.appendChild(script)
})
}
return window._BMap.scriptLoader
return window._BMap.scriptLoader
}
// 初始化地图
Expand Down Expand Up @@ -396,4 +388,9 @@
})
provide('getMapInstance', () => map)
provide('parentUidGetter', uid)
</script>
<script lang="ts">
export default {
name: 'BmMap'
}
</script>
5 changes: 5 additions & 0 deletions package/components/control/bm-city-list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,9 @@
ready(map)
return () => map.removeControl(cityListControl)
})
</script>
<script lang="ts">
export default {
name: 'BmCityList'
}
</script>
5 changes: 5 additions & 0 deletions package/components/control/bm-control/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@
})
})
</script>
<script lang="ts">
export default {
name: 'BmControl'
}
</script>
5 changes: 5 additions & 0 deletions package/components/control/bm-location/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@
ready(map)
return () => map.removeControl(locationControl)
})
</script>
<script lang="ts">
export default {
name: 'BmLocation'
}
</script>
5 changes: 5 additions & 0 deletions package/components/control/bm-navigation/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,9 @@
ready(map)
return () => map.removeControl(navigationControl)
})
</script>
<script lang="ts">
export default {
name: 'BmNavigation'
}
</script>
5 changes: 5 additions & 0 deletions package/components/control/bm-navigation3d/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@
return () => map.removeControl(navigation3dControl)
})
</script>
<script lang="ts">
export default {
name: 'BmNavigation3d'
}
</script>
5 changes: 5 additions & 0 deletions package/components/control/bm-scale/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@
scaleCtrl.setUnit(window[props.unit])
}
</script>
<script lang="ts">
export default {
name: 'BmScale'
}
</script>
5 changes: 5 additions & 0 deletions package/components/control/bm-zoom/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@
return () => map.removeControl(zoomControl)
})
</script>
<script lang="ts">
export default {
name: 'BmZoom'
}
</script>
5 changes: 5 additions & 0 deletions package/components/overlay/bm-circle/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,8 @@
enableEditing ? circle!.enableEditing() : circle!.disableEditing()
}
</script>
<script lang="ts">
export default {
name: 'BmCircle'
}
</script>
5 changes: 5 additions & 0 deletions package/components/overlay/bm-label/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,9 @@
function setMassClear(enableMassClear: boolean): void {
enableMassClear ? label!.enableMassClear() : label!.disableMassClear()
}
</script>
<script lang="ts">
export default {
name: 'BmLabel'
}
</script>
5 changes: 5 additions & 0 deletions package/components/overlay/bm-marker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,9 @@
function setRotation(rotation: number) {
marker.setRotation(rotation)
}
</script>
<script lang="ts">
export default {
name: 'BmMarker'
}
</script>
5 changes: 5 additions & 0 deletions package/components/overlay/bm-polygon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,8 @@
enableEditing ? polygon!.enableEditing() : polygon!.disableEditing()
}
</script>
<script lang="ts">
export default {
name: 'BmPolygon'
}
</script>
5 changes: 5 additions & 0 deletions package/components/overlay/bm-polyline/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,8 @@
enableEditing ? polyline!.enableEditing() : polyline!.disableEditing()
}
</script>
<script lang="ts">
export default {
name: 'BmPolyline'
}
</script>

0 comments on commit cf88695

Please sign in to comment.