Skip to content

Commit 17274f6

Browse files
authored
Merge pull request #191 from niceplugin/ko-kr/src/guide/built-ins
/src/guide/built-ins
2 parents 93cf83c + c5a6cef commit 17274f6

File tree

17 files changed

+355
-357
lines changed

17 files changed

+355
-357
lines changed

ko-KR/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export const sidebar = {
218218
]
219219
},
220220
{
221-
text: '내장 컴포넌트',
221+
text: '빌트인 컴포넌트',
222222
items: [
223223
{ text: 'Transition', link: '/guide/built-ins/transition' },
224224
{
-18.4 KB
Loading

ko-KR/src/guide/built-ins/keep-alive-demos/CompA.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let count = $ref(0)
33
</script>
44

55
<template>
6-
<p>Current component: A</p>
7-
<span style="margin-right:20px">count: {{ count }}</span>
6+
<p>현재 컴포넌트: A</p>
7+
<span style="margin-right:20px">카운트: {{ count }}</span>
88
<button @click="count++">+</button>
99
</template>

ko-KR/src/guide/built-ins/keep-alive-demos/CompB.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let msg = $ref('')
33
</script>
44

55
<template>
6-
<p>Current component: B</p>
7-
<span style="margin-right:20px;">Message is: {{ msg }}</span>
6+
<p>현재 컴포넌트: B</p>
7+
<span style="margin-right:20px;">메세지: {{ msg }}</span>
88
<input v-model="msg">
99
</template>

ko-KR/src/guide/built-ins/keep-alive.md

Lines changed: 55 additions & 45 deletions
Large diffs are not rendered by default.

ko-KR/src/guide/built-ins/teleport.md

Lines changed: 63 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
# Teleport
1+
# 텔레포트
22

3-
3+
`<Teleport>`는 컴포넌트 템플릿의 일부를 해당 컴포넌트의 DOM 계층 외부의 DOM 노드로 "이동"할 수 있게 해주는 빌트인 컴포넌트입니다.
44

5-
`<Teleport>` is a built-in component that allows us to "teleport" a part of a component's template into a DOM node that exists outside the DOM hierarchy of that component.
5+
## 기본 사용법
66

7-
## Basic Usage
7+
때때로 우리는 다음과 같은 시나리오에 직면할 수 있습니다.
8+
컴포넌트 템플릿의 일부가 논리적으로 여기에 속하지만,
9+
시각적인 관점에서 Vue 앱 외부의 다른 DOM 어딘가에 표시되어야 합니다.
810

9-
Sometimes we may run into the following scenario: a part of a component's template belongs to it logically, but from a visual standpoint, it should be displayed somewhere else in the DOM, outside of the Vue application.
11+
가장 일반적인 예는 전체 화면 모달을 구현할 때입니다.
12+
이상적으로는 모달의 버튼과 모달 자체가 동일한 컴포넌트 내에 있기를 원합니다.
13+
둘 다 모달의 열기/닫기 상태와 관련이 있기 때문입니다.
14+
그러나 이는 모달이 버튼과 함께 렌더링되고 앱의 DOM 계층 구조에 깊숙이 중첩되어 있음을 의미합니다.
15+
이것은 CSS를 통해 모달을 배치할 때 몇 가지 까다로운 문제를 일으킬 수 있습니다.
1016

11-
The most common example of this is when building a full-screen modal. Ideally, we want the modal's button and the modal itself to live within the same component, since they are both related to the open / close state of the modal. But that means the modal will be rendered alongside the button, deeply nested in the application's DOM hierarchy. This can create some tricky issues when positioning the modal via CSS.
12-
13-
Consider the following HTML structure.
17+
다음 HTML 구조를 고려하십시오.
1418

1519
```vue-html
1620
<div class="outer">
@@ -21,7 +25,7 @@ Consider the following HTML structure.
2125
</div>
2226
```
2327

24-
And here is the implementation of `<MyModal>`:
28+
다음은 `<MyModal>`의 구현입니다:
2529

2630
<div class="composition-api">
2731

@@ -33,11 +37,11 @@ const open = ref(false)
3337
</script>
3438
3539
<template>
36-
<button @click="open = true">Open Modal</button>
40+
<button @click="open = true">모달 열기</button>
3741
3842
<div v-if="open" class="modal">
39-
<p>Hello from the modal!</p>
40-
<button @click="open = false">Close</button>
43+
<p>짜자잔~ 모달입니다!</p>
44+
<button @click="open = false">닫기</button>
4145
</div>
4246
</template>
4347
@@ -68,11 +72,11 @@ export default {
6872
</script>
6973
7074
<template>
71-
<button @click="open = true">Open Modal</button>
75+
<button @click="open = true">모달 열기</button>
7276
7377
<div v-if="open" class="modal">
74-
<p>Hello from the modal!</p>
75-
<button @click="open = false">Close</button>
78+
<p>짜자잔~ 모달입니다!</p>
79+
<button @click="open = false">닫기</button>
7680
</div>
7781
</template>
7882
@@ -90,42 +94,46 @@ export default {
9094

9195
</div>
9296

93-
The component contains a `<button>` to trigger the opening of the modal, and a `<div>` with a class of `.modal`, which will contain the modal's content and a button to self-close.
97+
컴포넌트에는 모달의 열기를 트리거하는 `<button>``.modal` 클래스가 있는 `<div>`가 포함되어 있으며,
98+
여기에는 모달의 콘텐츠와 닫기 버튼이 포함됩니다.
9499

95-
When using this component inside the initial HTML structure, there are a number of potential issues:
100+
초기 HTML 구조 내에서 이 컴포넌트를 사용할 때, 여러 가지 잠재적인 문제가 있습니다:
96101

97-
- `position: fixed` only places the element relative to the viewport when no ancestor element has `transform`, `perspective` or `filter` property set. If, for example, we intend to animate the ancestor `<div class="outer">` with a CSS transform, it would break the modal layout!
102+
- `position: fixed`는 부모 엘리먼트에 `transform`, `perspective` 또는 `filter` 속성이 설정되지 않은 경우에만 뷰포트를 기준으로 엘리먼트를 배치합니다.
103+
예를 들어 CSS 트랜지션으로 조상 `<div class="outer">`에 애니메이션을 적용하려는 경우 모달 레이아웃이 깨집니다!
98104

99-
- The modal's `z-index` is constrained by its containing elements. If there is another element that overlaps with `<div class="outer">` and has a higher `z-index`, it would cover our modal.
105+
- 모달의 `z-index`는 모달을 포함하는 엘리먼트에 의해 제한됩니다.
106+
`<div class="outer">`와 겹치고 `z-index`가 더 높은 또 다른 엘리먼트가 있으면 모달을 덮을 것입니다.
100107

101-
`<Teleport>` provides a clean way to work around these, by allowing us to break out of the nested DOM structure. Let's modify `<MyModal>` to use `<Teleport>`:
108+
`<Teleport>`는 중첩된 DOM 구조에서 벗어날 수 있도록 하여 이러한 문제를 해결할 수 있는 깔끔한 방법을 제공합니다. `<Teleport>`를 사용하도록 `<MyModal>`을 수정해 보겠습니다:
102109

103110
```vue-html{3,8}
104-
<button @click="open = true">Open Modal</button>
111+
<button @click="open = true">모달 열기</button>
105112
106113
<Teleport to="body">
107114
<div v-if="open" class="modal">
108-
<p>Hello from the modal!</p>
109-
<button @click="open = false">Close</button>
115+
<p>짜자잔~ 모달입니다!</p>
116+
<button @click="open = false">닫기</button>
110117
</div>
111118
</Teleport>
112119
```
113120

114-
The `to` target of `<Teleport>` expects a CSS selector string or an actual DOM node. Here, we are essentially telling Vue to "**teleport** this template fragment **to** the **`body`** tag".
121+
`<Teleport>``to` 대상은 CSS 셀렉터 문자열 또는 실제 DOM 노드여야 합니다.
122+
여기서 우리는 Vue에게 이 템플릿 조각을 **`body`** 태그로 **이동**하도록 지시합니다.
115123

116-
You can click the button below and inspect the `<body>` tag via your browser's devtools:
124+
아래 버튼을 클릭하고 브라우저의 개발자도구를 통해 `<body>` 태그를 확인해 봅시다:
117125

118126
<script setup>
119127
let open = $ref(false)
120128
</script>
121129

122130
<div class="demo">
123-
<button @click="open = true">Open Modal</button>
131+
<button @click="open = true">모달 열기</button>
124132
<ClientOnly>
125133
<Teleport to="body">
126134
<div v-if="open" class="demo modal-demo">
127-
<p style="margin-bottom:20px">Hello from the modal!</p>
128-
<button @click="open = false">Close</button>
135+
<p style="margin-bottom:20px">짜자잔~ 모달입니다!</p>
136+
<button @click="open = false">닫기</button>
129137
</div>
130138
</Teleport>
131139
</ClientOnly>
@@ -146,35 +154,45 @@ let open = $ref(false)
146154
}
147155
</style>
148156

149-
You can combine `<Teleport>` with [`<Transition>`](./transition) to create animated modals - see [Example here](/examples/#modal).
157+
`<Teleport>`[`<Transition>`](./transition)과 결합하여 애니메이션 모달을 만들 수 있습니다.
158+
[예제](/examples/#modal)를 참고하세요.
150159

151160
:::tip
152-
The teleport `to` target must be already in the DOM when the `<Teleport>` component is mounted. Ideally, this should be an element outside the entire Vue application. If targeting another element rendered by Vue, you need to make sure that element is mounted before the `<Teleport>`.
161+
`<Teleport>` 컴포넌트가 `to` 대상으로 이동하여 마운트 되기 전, 대상은 이미 DOM에 있어야 합니다.
162+
이상적으로는 전체 Vue 앱 외부의 엘리먼트여야 합니다.
163+
Vue에서 렌더링한 다른 엘리먼트를 대상으로 하는 경우, `<Teleport>` 전에 해당 엘리먼트가 마운트되었는지 확인해야 합니다.
153164
:::
154165

155-
## Using with Components
166+
## 컴포넌트와 함께 사용하기
156167

157-
`<Teleport>` only alters the rendered DOM structure - it does not affect the logical hierarchy of the components. That is to say, if `<Teleport>` contains a component, that component will remain a logical child of the parent component containing the `<Teleport>`. Props passing and event emitting will continue to work the same way.
168+
`<Teleport>`는 렌더링된 DOM 구조만 변경하며 컴포넌트의 논리적 계층 구조에는 영향을 주지 않습니다.
169+
즉, `<Teleport>`에 컴포넌트가 포함되어 있으면, 해당 컴포넌트는 논리적으로 `<Teleport>`를 포함하는 부모 컴포넌트의 자식으로 유지됩니다.
170+
Props 전달() 및 이벤트 발신(emit)은 계속 동일한 방식으로 작동합니다.
158171

159-
This also means that injections from a parent component work as expected, and that the child component will be nested below the parent component in the Vue Devtools, instead of being placed where the actual content moved to.
172+
이것은 부모 컴포넌트로부터 주입되어 예상대로 작동함을 의미합니다.
173+
또한 자식 컴포넌트는 실제 컨텐츠가 이동한 위치에 배치되지만, Vue 개발자도구에서는 부모 컴포넌트 내부에 위치합니다.
160174

161-
## Disabling Teleport
175+
## 텔레포트 비활성화
162176

163-
In some cases, we may want to conditionally disable `<Teleport>`. For example, we may want to render a component as an overlay for desktop, but inline on mobile. `<Teleport>` supports the `disabled` prop which can be dynamically toggled:
177+
경우에 따라 `<Teleport>`를 조건부로 비활성화 할 수 있습니다.
178+
예를 들어 컴포넌트를 데스크톱용 오버레이로 렌더링하지만 모바일에서는 인라인으로 렌더링할 수 있습니다.
179+
`<Teleport>`는 동적으로 토글할 수 있는 `disabled` prop을 지원합니다:
164180

165181
```vue-html
166182
<Teleport :disabled="isMobile">
167183
...
168184
</Teleport>
169185
```
170186

171-
Where the `isMobile` state can be dynamically updated by detecting media query changes.
187+
미디어 쿼리 변경을 감지하여 `isMobile` 상태를 동적으로 업데이트할 수 있습니다.
172188

173-
## Multiple Teleports on the Same Target
189+
## 같은 대상에 여러 텔레포트 사용
174190

175-
A common use case would be a reusable `<Modal>` component, with the potential for multiple instances to be active at the same time. For this kind of scenario, multiple `<Teleport>` components can mount their content to the same target element. The order will be a simple append - later mounts will be located after earlier ones within the target element.
191+
일반적인 사용 사례는 여러 인스턴스가 동시에 활성화될 가능성이 있는 재사용 가능한 `<Modal>` 컴포넌트입니다.
192+
이러한 종류의 시나리오에서는 여러 `<Teleport>` 컴포넌트의 콘텐츠를 동일한 대상 엘리먼트에 탑재할 수 있습니다.
193+
순서는 단순히 추가한 순서대로 이므로, `<Teleport>` 컴포넌트 마운트는 대상 엘리먼트 내 이전 마운트 다음에 위치합니다.
176194

177-
Given the following usage:
195+
다음과 같이 사용할 때:
178196

179197
```vue-html
180198
<Teleport to="#modals">
@@ -185,7 +203,7 @@ Given the following usage:
185203
</Teleport>
186204
```
187205

188-
The rendered result would be:
206+
렌더링된 결과는 다음과 같습니다:
189207

190208
```html
191209
<div id="modals">
@@ -196,7 +214,9 @@ The rendered result would be:
196214

197215
---
198216

199-
**Related**
217+
**관련 문서**
218+
219+
- [`<Teleport>` API 참고](/api/built-in-components.html#teleport)
220+
- [SSR에서 텔레포트 핸들링](/guide/scaling-up/ssr.html#teleports)
200221

201-
- [`<Teleport>` API reference](/api/built-in-components.html#teleport)
202-
- [Handling Teleports in SSR](/guide/scaling-up/ssr.html#teleports)
222+
[comment]: <> (/guide/scaling-up/ssr.md 문서 번역 후 링크 수정 필요)

ko-KR/src/guide/built-ins/transition-demos/Basic.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ let show = $ref(true)
44

55
<template>
66
<div class="demo">
7-
<button @click="show = !show">Toggle Fade</button>
7+
<button @click="show = !show">토글</button>
88
<Transition name="fade">
9-
<p style="margin-top: 20px" v-if="show">hello</p>
9+
<p style="margin-top: 20px" v-if="show">안녕</p>
1010
</Transition>
1111
</div>
1212
</template>

ko-KR/src/guide/built-ins/transition-demos/BetweenComponents.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup>
22
import { h } from 'vue'
33
4-
const CompA = () => h('div', 'Component A')
5-
const CompB = () => h('div', 'Component B')
4+
const CompA = () => h('div', 'A 컴포넌트')
5+
const CompB = () => h('div', 'B 컴포넌트')
66
77
let activeComponent = $ref(CompA)
88
</script>

ko-KR/src/guide/built-ins/transition-demos/BetweenElements.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ let docState = $ref('saved')
66

77
<template>
88
<div class="demo transition-demo">
9-
<span style="margin-right: 20px">Click to cycle through states:</span>
9+
<span style="margin-right: 20px">클릭 시 상태 변경:</span>
1010
<div class="btn-container">
1111
<Transition name="slide-up" :mode="mode">
1212
<button v-if="docState === 'saved'" @click="docState = 'edited'">
13-
Edit
13+
수정
1414
</button>
1515
<button v-else-if="docState === 'edited'" @click="docState = 'editing'">
16-
Save
16+
저장
1717
</button>
1818
<button v-else-if="docState === 'editing'" @click="docState = 'saved'">
19-
Cancel
19+
취소
2020
</button>
2121
</Transition>
2222
</div>
@@ -37,6 +37,7 @@ let docState = $ref('saved')
3737
3838
.transition-demo button {
3939
position: absolute;
40+
white-space: pre;
4041
}
4142
4243
.transition-demo button + button {

ko-KR/src/guide/built-ins/transition-demos/CssAnimation.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ let show = $ref(true)
44

55
<template>
66
<div class="demo">
7-
<button @click="show = !show">Toggle</button>
7+
<button @click="show = !show">토글</button>
88
<Transition name="bounce">
99
<p v-if="show" style="margin-top: 20px; text-align: center;">
10-
Hello here is some bouncy text!
10+
안녕! 여기에 탄력적인 텍스트가 있어요!
1111
</p>
1212
</Transition>
1313
</div>

0 commit comments

Comments
 (0)