You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -99,7 +105,7 @@ A utility for waiting for the next DOM update flush.
99
105
100
106
## defineComponent()
101
107
102
-
Atypehelper for defining a Vue component with type inference.
108
+
타입 추론으로 Vue컴포넌트를 정의하기 위한 타입 핼퍼입니다.
103
109
104
110
-**타입**:
105
111
@@ -109,39 +115,30 @@ A type helper for defining a Vue component with type inference.
109
115
): ComponentConstructor
110
116
```
111
117
112
-
>Typeissimplifiedforreadability.
118
+
>타입은 가독성을 위해 단순화되었습니다.
113
119
114
120
-**세부 사항**:
115
121
116
-
Thefirstargumentexpectsacomponentoptionsobject. Thereturnvaluewillbethesameoptionsobject, sincethefunction is essentially a runtime no-op for type inference purposes only.
122
+
첫 번째 인자로 컴포넌트 옵션 객체가 필요합니다.
123
+
이 함수는 본질적으로 타입 추론 목적이므로, 동일한 옵션 객체를 반환하며, 런타임에 작동하지 않습니다.
117
124
118
-
Note that the return type is a bit special: it will be a constructor type whose instance type is the inferred component instance type based on the options. This is used for type inference when the returned type is used as a tag in TSX.
125
+
반환 타입은 약간 특별한데, 옵션을 기반으로 추론된 컴포넌트 인스턴스 타입인 생성자 타입이 됩니다.
126
+
이것은 반환된 타입이 TSX에서 태그로 사용될 때 타입 추론에 사용됩니다.
119
127
120
-
You can extract the instance type of a component (equivalenttothetypeof`this`initsoptions) from the return type of `defineComponent()` like this:
128
+
다음과 같이 `defineComponent()`의 반환 타입에서 컴포넌트의 인스턴스 타입(해당 옵션의 `this`타입과 동일)을 추출할 수 있습니다:
121
129
122
130
```ts
123
131
const Foo = defineComponent(/* ... */)
124
132
125
133
type FooInstance = InstanceType<typeof Foo>
126
134
```
127
135
128
-
### Note on webpack Treeshaking
129
-
130
-
Because `defineComponent()` is a function call, it could look like that it would produce side-effects to some build tools, e.g. webpack. This will prevent the component from being tree-shaken even when the component is never used.
131
-
132
-
To tell webpack that this function call is safe to be tree-shaken, you can add a `/*#__PURE__*/` comment notation before the function call:
Note this is not necessary if you are using Vite, because Rollup (theunderlyingproductionbundlerusedbyVite) is smart enough to determine that `defineComponent()` is in fact side-effect-free without the need for manual annotations.
139
-
140
-
- **참고**: [가이드 - Using Vue with TypeScript](/guide/typescript/overview.html#general-usage-notes)
Define an async component which is lazy loaded only when it is rendered. The argument can either be a loader function, or an options object for more advanced control of the loading behavior.
140
+
렌더링될 때 지연 로드되는 비동기 컴포넌트를 정의합니다.
141
+
인자는 로더 함수이거나 로드 동작의 고급 제어를 위한 옵션 객체일 수 있습니다.
145
142
146
143
-**타입**:
147
144
@@ -168,11 +165,12 @@ Define an async component which is lazy loaded only when it is rendered. The arg
This method accepts the same argument as [`defineComponent`](#definecomponent), but instead returns a native [Custom Element](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) class constructor.
172
+
이 메서드는 [`defineComponent`](#definecomponent)와 동일한 인자를 사용하지만,
173
+
네이티브 [커스텀 엘리먼트](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) 클래스 생성자를 반환합니다.
176
174
177
175
-**타입**:
178
176
@@ -186,29 +184,30 @@ This method accepts the same argument as [`defineComponent`](#definecomponent),
186
184
}
187
185
```
188
186
189
-
> Type is simplified for readability.
187
+
>타입은 가독성을 위해 단순화되었습니다.
190
188
191
189
-**세부 사항**:
192
190
193
-
In addition to normal component options, `defineCustomElement()` also supports a special option `styles`, which should be an array of inlined CSS strings, for providing CSS that should be injected into the element's shadow root.
191
+
`defineCustomElement()`는 일반 컴포넌트 옵션 외에도 추가로 엘리먼트의 [섀도우 루트](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot)에 삽입되어야 하는 CSS를 제공하기 위해,
192
+
인라인 CSS 문자열을 배열로 감싼 특수 옵션 `styles`도 지원합니다.
194
193
195
-
The return value is a custom element constructor that can be registered using [`customElements.define()`](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define).
194
+
반환 값은 [`customElements.define()`](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define)을 사용하여 등록할 수 있는 커스텀 엘리먼트 생성자입니다.
-Also note that `defineCustomElement()` requires [special config](/guide/extras/web-components.html#sfc-as-custom-element) when used with Single-File Components.
213
+
-`defineCustomElement()`는 싱글 파일 컴포넌트와 함께 사용할 때, [특별한 설정](/guide/extras/web-components.html#sfc-as-custom-element)이 필요합니다.
0 commit comments