refactor(projects): 代码优化

This commit is contained in:
Soybean
2022-06-11 13:37:52 +08:00
parent 8e6e787543
commit 5fa822f4d4
3 changed files with 12 additions and 12 deletions

View File

@ -11,19 +11,19 @@ const { load } = useScriptTag(TENCENT_MAP_SDK_URL);
const domRef = ref<HTMLDivElement | null>(null);
async function renderBaiduMap() {
if (!domRef.value) return;
async function renderMap() {
await load(true);
const map = new TMap.Map(domRef.value, {
if (!domRef.value) return;
// eslint-disable-next-line no-new
new TMap.Map(domRef.value, {
center: new TMap.LatLng(39.98412, 116.307484),
zoom: 11,
viewMode: '3D'
});
window.console.log(map);
}
onMounted(() => {
renderBaiduMap();
renderMap();
});
</script>