Skip to content

Commit

Permalink
feat(docs): add example components
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongkyuuuu committed Sep 16, 2021
1 parent 9a23f92 commit 8f5eab1
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ $ yarn add vue3-naver-maps

## Contributing Guide

현재 `vue3-naver-maps`는 계속 작성해 나가고 있습니다. 자유롭게 [Issue](https://github.com/DongKyuuuu/vue3-naver-maps/issues) 혹은 [Pull Request](https://github.com/DongKyuuuu/vue3-naver-maps/pulls)를 통해 기여 가능합니다. **여러분들의 기여를 두 팔 벌려 환영합니다 👍**
현재 `vue3-naver-maps`는 계속 작성해 나가고 있습니다. 자유롭게 [Issue](https://github.com/DongKyuuuu/vue3-naver-maps/issues) 혹은 [Pull Request](https://github.com/DongKyuuuu/vue3-naver-maps/pulls)를 통해 기여 가능합니다. 👍
11 changes: 0 additions & 11 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ const config = {
},
},

head: [
[
"script",
{
href: "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9675166132883612",
crossorigin: "anonymous",
async: "",
},
],
],

themeConfig: {
repo: "DongKyuuuu/vue3-naver-maps",
docsRepo: "DongKyuuuu/vue3-naver-maps",
Expand Down
15 changes: 15 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import theme from "vitepress/dist/client/theme-default";
import Vue3NaverMaps, {
NaverMaps,
NaverMarker,
} from "../../../dist/vue3-naver-maps";

export default {
...theme,
enhanceApp({ app, router, siteData }) {
app.use(Vue3NaverMaps, { clientId: "krm0ye8xno" });

app.component("naver-maps", NaverMaps);
app.component("naver-marker", NaverMarker);
},
};
11 changes: 7 additions & 4 deletions docs/guide/Maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## 예시

\
<naver-maps width="100%" :mapOptions="{latitude: 37.56663888630603, longitude: 126.97838310403904, zoom: 16, zoomControl: false, zoomControlOptions: { position: 'TOP_RIGHT' }}">
</naver-maps>

```vue
<template>
<naver-maps
Expand All @@ -25,12 +29,11 @@ export default {
setup: () => {
const map = ref(null);
const mapOptions = {
latitude: 36, // 지도 중앙 위도
longitude: 126, // 지도 중앙 경도
zoom: 12,
latitude: 37.56663888630603, // 지도 중앙 위도
longitude: 126.97838310403904, // 지도 중앙 경도
zoom: 16,
zoomControl: false,
zoomControlOptions: { position: "TOP_RIGHT" },
mapTypeControl: false,
};
const initLayers = [
"BACKGROUND",
Expand Down
9 changes: 7 additions & 2 deletions docs/guide/Marker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@

## 예시

\
<naver-maps width="100%" :mapOptions="{latitude: 37.56663888630603, longitude: 126.97838310403904, zoom: 16, zoomControl: false, zoomControlOptions: { position: 'TOP_RIGHT' }}">
<naver-marker :latitude="37.56663888630603" :longitude="126.97838310403904" />
</naver-maps>

```vue
<template>
<naver-maps>
<naver-marker
:latitude="37"
:longitude="126"
:latitude="37.56663888630603"
:longitude="126.97838310403904"
@click="alertMarker()"
@onLoad="onLoadMarker($event)"
>
Expand Down
7 changes: 2 additions & 5 deletions playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@
<script lang="ts">
import { defineComponent, reactive, ref, computed } from "vue";
import type { naverV3 } from "../dist/vue3-naver-maps";
import { NaverMaps, NaverMarker, useMap } from "../dist/vue3-naver-maps";
import { NaverMaps, NaverMarker } from "../dist/vue3-naver-maps";
export default defineComponent({
components: { NaverMaps, NaverMarker },
name: "App",
setup: (props, { emit }) => {
const map = ref<naver.maps.Map | null>(null);
const { setZoom } = useMap();
const mapSize = reactive({
width: "400px",
height: "400px",
Expand Down Expand Up @@ -62,9 +61,7 @@ export default defineComponent({
console.log(event);
};
const change = () => {
setZoom(5);
};
const change = () => {};
return {
mapOptions,
initLayers,
Expand Down

0 comments on commit 8f5eab1

Please sign in to comment.