[go: up one dir, main page]

Skip to content

Commit

Permalink
feat(playground): add embed example
Browse files Browse the repository at this point in the history
  • Loading branch information
CofCat456 committed Sep 1, 2023
1 parent fff58d0 commit b621a9a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
"vue": "^3.3.4"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue": "^4.3.4",
"naive-ui": "^2.34.4",
"typescript": "^5.1.6",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vue-tsc": "^1.8.8"
}
Expand Down
5 changes: 3 additions & 2 deletions playground/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<script setup lang="ts">
import { NConfigProvider, NTabPane, NTabs, darkTheme } from 'naive-ui';
import { Basic, InfoWindow, Marker, MarkerClusterer } from './components/Map';
import { Basic, Embed, InfoWindow, Marker, MarkerClusterer } from './components/Map';
import Core from './components/Core';
const elementMap = new Map<string, any>()
.set('Core', Core)
.set('Basic', Basic)
.set('Marker', Marker)
.set('InfoWindow', InfoWindow)
.set('MarkerClusterer', MarkerClusterer);
.set('MarkerClusterer', MarkerClusterer)
.set('Embed', Embed);
</script>

<template>
Expand Down
14 changes: 14 additions & 0 deletions playground/src/components/Map/EmbedExample.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script setup lang="ts">
import { Embed } from '@voomap/map';
const { VITE_GOOGLE_MAP_API_KEY } = import.meta.env;
</script>

<template>
<Embed
width="100%"
height="100%"
:api-key="VITE_GOOGLE_MAP_API_KEY"
address="Dreamers Coffee Roasters 忠孝復興店"
/>
</template>
2 changes: 2 additions & 0 deletions playground/src/components/Map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import Basic from './BasicExample.vue';
import Marker from './MarkerExample.vue';
import MarkerClusterer from './MarkerClustererExample.vue';
import InfoWindow from './InfoWindowExample.vue';
import Embed from './EmbedExample.vue';

export {
Basic,
Marker,
MarkerClusterer,
InfoWindow,
Embed,
};

0 comments on commit b621a9a

Please sign in to comment.