Skip to content

Commit

Permalink
feat(docs): add new docs migration from 3.x (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongkyuuuu authored Dec 28, 2022
1 parent 65f073d commit 6db989f
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ const config = {
text: "2.x λ²„μ „μœΌλ‘œ λΆ€ν„° λ§ˆμ΄κ·Έλ ˆμ΄μ…˜",
link: "/migrations/from2",
},
{
text: "3.x λ²„μ „μœΌλ‘œ λΆ€ν„° λ§ˆμ΄κ·Έλ ˆμ΄μ…˜",
link: "/migrations/from3",
},
],
},
],
Expand Down
57 changes: 57 additions & 0 deletions docs/migrations/from3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 3.x λ²„μ „μœΌλ‘œ λΆ€ν„° λ§ˆμ΄κ·Έλ ˆμ΄μ…˜

4.x 버전은 3.xμ—μ„œ 전체적인 μ½”λ“œ λ¦¬νŒ©ν† λ§ μž‘μ—…κ³Ό `install` 뢀뢄이 λ³€κ²½ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

## vue3-naver-maps μ„€μΉ˜ μ‹œ, μ„€μΉ˜ λͺ¨λ“ˆ 이름 λ³€κ²½

μžμ„Έν•œ 예제 μ½”λ“œλŠ” [μ„€μΉ˜ν•˜κΈ° - 섀정방법](../start/install.md)μ—μ„œ 확인 κ°€λŠ₯ν•©λ‹ˆλ‹€.

### 3.x 이전

3.x 이전 μ—λŠ” `vue3-naver-maps`μ—μ„œ `export default`둜 호좜 된 값을 install module둜 μ‚¬μš© ν•˜μ˜€μŠ΅λ‹ˆλ‹€.

```javascript
import { createApp } from "vue";
import App from "./app.vue";
import naver from "vue3-naver-maps";

const app = createApp(App);

app.use(naver, { clientId: "your clientId" }).mount("#app");
```

### 4.x 이후

4.x 이후 λΆ€ν„°λŠ” `createNaverMap`μ΄λΌλŠ” λͺ…ν™•ν•œ install module을 μ‚¬μš©ν•©λ‹ˆλ‹€.

```javascript
import { createApp } from "vue";
import App from "./app.vue";
import { createNaverMap } from "vue3-naver-maps";

const app = createApp(App);

app.use(createNaverMap, { clientId: "your clientId" }).mount("#app");
```

## μ„€μΉ˜ μ˜΅μ…˜ `subModules` λ³€κ²½

κΈ°μ‘΄ `string`에 `,`둜 μ—¬λŸ¬ λͺ¨λ“ˆμ„ μ‚¬μš© ν–ˆλ‹€λ©΄, 4.x 이후 λΆ€ν„° `array`둜 ν•„μš”ν•œ λͺ¨λ“ˆμ„ λΆˆλŸ¬μ™€μ„œ μ‚¬μš© ν•©λ‹ˆλ‹€.

λ˜ν•œ `SubModules` νƒ€μž…μŠ€ν¬λ¦½νŠΈ μœ μ €λ₯Ό μœ„ν•œ νƒ€μž…μ„ μ œκ³΅ν•©λ‹ˆλ‹€.

```typescript
import { createApp } from "vue";
import App from "./app.vue";
import { createNaverMap } from "vue3-naver-maps";
import type { SubModules } from "vue3-naver-maps"; // subModule type

const app = createApp(App);

app
.use(createNaverMap, {
clientId: "your clientId", // Required
subModules: [] as SubModules,
})
.mount("#app");
```

0 comments on commit 6db989f

Please sign in to comment.