Skip to content

Commit 66e5866

Browse files
committed
문서 번역: api/sfc-spec.md
원문 삭제: guide/scaling-up/tooling.md
1 parent f2ffe84 commit 66e5866

File tree

3 files changed

+64
-51
lines changed

3 files changed

+64
-51
lines changed

ko-KR/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export const sidebar = {
404404
{
405405
text: '싱글 파일 컴포넌트',
406406
items: [
407-
{ text: '문법 규약', link: '/api/sfc-spec' },
407+
{ text: '문법 설명서', link: '/api/sfc-spec' },
408408
{ text: '<script setup>', link: '/api/sfc-script-setup' },
409409
{ text: 'CSS Features', link: '/api/sfc-css-features' }
410410
]

ko-KR/src/api/sfc-spec.md

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
:::warning 현재 이 문서는 번역 작업이 진행중입니다
2-
:::
1+
# SFC 문법 설명서 {#sfc-syntax-specification}
32

4-
# SFC Syntax Specification
3+
## 개요 {#overview}
54

6-
## Overview
5+
일반적으로 `*.vue` 파일 확장자를 사용하는 Vue 싱글 파일 컴포넌트(SFC)는 HTML과 유사한 문법을 사용하여 Vue 컴포넌트를 설명하는 커스텀 파일 형식입니다.
6+
Vue SFC는 HTML과 문법적으로 호환됩니다.
77

8-
A Vue Single File Component (SFC), conventionally using the `*.vue` file extension, is a custom file format that uses an HTML-like syntax to describe a Vue component. A Vue SFC is syntactically compatible with HTML.
9-
10-
Each `*.vue` file consists of three types of top-level language blocks: `<template>`, `<script>`, and `<style>`, and optionally additional custom blocks:
8+
`*.vue` 파일은 세 가지 유형의 최상위 언어 블록(`<template>`, `<script>`, `<style>`)과 선택적으로 추가 커스텀 블록으로 구성됩니다:
119

1210
```vue
1311
<template>
@@ -18,7 +16,7 @@ Each `*.vue` file consists of three types of top-level language blocks: `<templa
1816
export default {
1917
data() {
2018
return {
21-
msg: 'Hello world!'
19+
msg: '안녕 Vue!'
2220
}
2321
}
2422
}
@@ -31,67 +29,80 @@ export default {
3129
</style>
3230
3331
<custom1>
34-
This could be e.g. documentation for the component.
32+
예를 들어 컴포넌트 설명서가 될 수 있습니다.
3533
</custom1>
3634
```
3735

38-
## Language Blocks
36+
## 언어 블럭 {#language-blocks}
3937

4038
### `<template>`
4139

42-
- Each `*.vue` file can contain at most one top-level `<template>` block at a time.
40+
- `*.vue` 파일은 최상위 `<template>` 블록은 하나만 포함할 수 있습니다.
4341

44-
- Contents will be extracted and passed on to `@vue/compiler-dom`, pre-compiled into JavaScript render functions, and attached to the exported component as its `render` option.
42+
- 콘텐츠는 추출되어 `@vue/compiler-dom`으로 전달되고,
43+
JavaScript 렌더 함수로 사전 컴파일되며,
44+
내보낸 컴포넌트에 `render` 옵션으로 첨부됩니다.
4545

4646
### `<script>`
4747

48-
- Each `*.vue` file can contain at most one `<script>` block at a time (excluding [`<script setup>`](/api/sfc-script-setup.html)).
48+
- `*.vue` 파일은 하나의 `<script>` 블록만 포함할 수 있습니다([`<script setup>`](/api/sfc-script-setup.html) 제외).
4949

50-
- The script is executed as an ES Module.
50+
- 스크립트는 ES 모듈로 실행됩니다.
5151

52-
- The **default export** should be a Vue component options object, either as a plain object or as the return value of [defineComponent](/api/general.html#definecomponent).
52+
- **기본 내보내기**는 일반 객체 또는 [defineComponent](/api/general.html#definecomponent)의 반환 값으로 Vue 컴포넌트 옵션 객체여야 합니다.
5353

5454
### `<script setup>`
5555

56-
- Each `*.vue` file can contain at most one `<script setup>` block at a time (excluding normal `<script>`).
56+
- `*.vue` 파일은 하나의 `<script setup>` 블록만 포함할 수 있습니다(일반 `<script>` 제외).
5757

58-
- The script is pre-processed and used as the component's `setup()` function, which means it will be executed **for each instance of the component**. Top-level bindings in `<script setup>` are automatically exposed to the template. For more details, see [dedicated documentation on `<script setup>`](/api/sfc-script-setup).
58+
- 스크립트는 전처리되어 컴포넌트의 `setup()` 함수로 사용됩니다.
59+
즉, **컴포넌트의 각 인스턴스**에 대해 실행됩니다.
60+
`<script setup>` 내에 최상위 바인딩은 템플릿에 자동으로 노출됩니다.
61+
자세한 내용은 [`<script setup>` 전용 문서](/api/sfc-script-setup)를 참조하십시오.
5962

6063
### `<style>`
6164

62-
- A single `*.vue` file can contain multiple `<style>` tags.
65+
- `*.vue` 파일에는 여러 `<style>` 태그가 포함될 수 있습니다.
6366

64-
- A `<style>` tag can have `scoped` or `module` attributes (see [SFC Style Features](/api/sfc-css-features) for more details) to help encapsulate the styles to the current component. Multiple `<style>` tags with different encapsulation modes can be mixed in the same component.
67+
- `<style>` 태그는 현재 컴포넌트에 스타일을 캡슐화하는 데 도움이 되도록,
68+
`scoped` 또는 `module` 속성(자세한 내용은 [SFC 스타일 특징](/api/sfc-css-features) 참고)을 가질 수 있습니다.
69+
캡슐화 모드가 다른 여러 `<style>` 태그를 동일한 컴포넌트에 혼합할 수 있습니다.
6570

66-
### Custom Blocks
71+
### 커스텀 블럭 {#custom-blocks}
6772

68-
Additional custom blocks can be included in a `*.vue` file for any project-specific needs, for example a `<docs>` block. Some real-world examples of custom blocks include:
73+
프로젝트별 요구 사항에 따라 `*.vue` 파일에 추가 커스텀 블록을 포함할 수 있습니다(예: `<docs>` 블록).
74+
커스텀 블록의 실제 예는 다음과 같습니다:
6975

7076
- [Gridsome: `<page-query>`](https://gridsome.org/docs/querying-data/)
7177
- [vite-plugin-vue-gql: `<gql>`](https://github.com/wheatjs/vite-plugin-vue-gql)
7278
- [vue-i18n: `<i18n>`](https://github.com/intlify/bundle-tools/tree/main/packages/vite-plugin-vue-i18n#i18n-custom-block)
7379

74-
Handling of Custom Blocks will depend on tooling - if you want to build your own custom block integrations, see [relevant tooling section](/guide/scaling-up/tooling.html#sfc-custom-block-integrations) for more details.
80+
커스텀 블록 처리는 도구에 따라 다릅니다.
81+
자체 커스텀 블록 통합을 구축하려는 경우 자세한 내용은 [도구 섹션](/guide/scaling-up/tooling.html#sfc-custom-block-integrations)을 참고하십시오.
7582

76-
## Automatic Name Inference
83+
## 자동으로 이름 추론 {#automatic-name-inference}
7784

78-
An SFC automatically infers the component's name from its **filename** in the following cases:
85+
다음과 같은 경우, SFC **파일 이름**에서 컴포넌트의 이름을 자동으로 유추합니다:
7986

80-
- Dev warning formatting
81-
- DevTools inspection
82-
- Recursive self-reference. E.g. a file named `FooBar.vue` can refer to itself as `<FooBar/>` in its template. This has lower priority than explicitly registered/imported components.
87+
- 개발 경고 포멧팅
88+
- DevTools 검사
89+
- 재귀적 자기 참조.
90+
예를 들어 `FooBar.vue`라는 파일은 템플릿에서 `<FooBar/>`로 자신을 참조할 수 있음.
91+
명시적으로 등록/가져온 컴포넌트보다 우선 순위가 낮음.
8392

84-
## Pre-Processors
93+
## 전처리기 {#pre-processors}
8594

86-
Blocks can declare pre-processor languages using the `lang` attribute. The most common case is using TypeScript for the `<script>` block:
95+
블록은 `lang` 속성을 사용하여 전처리기 언어를 선언할 수 있습니다.
96+
가장 일반적인 경우는 `<script>` 블록에 TypeScript를 사용하는 것입니다:
8797

8898
```vue-html
8999
<script lang="ts">
90-
// use TypeScript
100+
// TypeScript 사용
91101
</script>
92102
```
93103

94-
`lang` can be applied to any block - for example we can use `<style>` with [SASS](https://sass-lang.com/) and `<template>` with [Pug](https://pugjs.org/api/getting-started.html):
104+
`lang`은 모든 블록에 적용할 수 있습니다.
105+
예를 들어 `<style>`에서는 [SASS](https://sass-lang.com/)를, `<template>`에서는 [Pug](https://pugjs.org/api/getting-started.html)를 사용할 수 있습니다:
95106

96107
```vue-html
97108
<template lang="pug">
@@ -106,39 +117,44 @@ p {{ msg }}
106117
</style>
107118
```
108119

109-
Note that integration with various pre-processors may differ by toolchain. Check out the respective documentation for examples:
120+
다양한 전처리기와의 통합은 툴체인에 따라 다를 수 있습니다.
121+
예제를 보려면 해당 문서를 확인하십시오:
110122

111123
- [Vite](https://vitejs.dev/guide/features.html#css-pre-processors)
112124
- [Vue CLI](https://cli.vuejs.org/guide/css.html#pre-processors)
113125
- [webpack + vue-loader](https://vue-loader.vuejs.org/guide/pre-processors.html#using-pre-processors)
114126

115-
## Src Imports
127+
## Src 가져오기 {#src-imports}
116128

117-
If you prefer splitting up your `*.vue` components into multiple files, you can use the `src` attribute to import an external file for a language block:
129+
`*.vue` 컴포넌트를 여러 파일로 분할하는 것을 선호하는 경우,
130+
`src` 속성을 사용하여 언어 블록에서 외부 파일을 가져올 수 있습니다:
118131

119132
```vue
120133
<template src="./template.html"></template>
121134
<style src="./style.css"></style>
122135
<script src="./script.js"></script>
123136
```
124137

125-
Beware that `src` imports follow the same path resolution rules as webpack module requests, which means:
138+
`src` 가져오기는 웹팩 모듈 요청과 동일한 경로 확인 규칙을 따릅니다.
139+
즉, 다음을 의미합니다:
126140

127-
- Relative paths need to start with `./`
128-
- You can import resources from npm dependencies:
141+
- 상대 경로는 `./`로 시작해야 함.
142+
- npm 종속성에서 리소스를 가져올 수 있음.
129143

130144
```vue
131-
<!-- import a file from the installed "todomvc-app-css" npm package -->
145+
<!-- 설치된 "todomvc-app-css" npm 패키지에서 파일 가져오기 -->
132146
<style src="todomvc-app-css/index.css" />
133147
```
134148

135-
`src` imports also work with custom blocks, e.g.:
149+
`src` 가져오기는 커스텀 블록에서도 작동합니다. 예를들어:
136150

137151
```vue
138152
<unit-test src="./unit-test.js">
139153
</unit-test>
140154
```
141155

142-
## Comments
156+
## 주석 {#comments}
143157

144-
Inside each block you shall use the comment syntax of the language being used (HTML, CSS, JavaScript, Pug, etc.). For top-level comments, use HTML comment syntax: `<!-- comment contents here -->`
158+
각 블록 내에서 사용 중인 언어(HTML, CSS, JavaScript, Pug 등)의 주석 문법을 사용해야 합니다.
159+
최상위 주석의 경우 HTML 주석 문법을 사용하십시오:
160+
`<!-- 컴포넌트 주석 -->`

ko-KR/src/guide/scaling-up/tooling.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,17 @@ Vue 팀은 SFC별 린팅 규칙을 지원하는 [ESLint](https://eslint.org/)
138138

139139
- 또는 [Prettier](https://prettier.io/)는 빌트인 Vue SFC 형식 지원을 제공합니다.
140140

141-
## SFC Custom Block Integrations {#sfc-custom-block-integrations}
142-
143-
Custom blocks are compiled into imports to the same Vue file with different request queries. It is up to the underlying build tool to handle these import requests.
144-
145-
- If using Vite, a custom Vite plugin should be used to transform matched custom blocks into executable JavaScript. [Example](https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-transforming-custom-blocks)
146-
147-
- If using Vue CLI or plain webpack, a webpack loader should be configured to transform the matched blocks. [Example](https://vue-loader.vuejs.org/guide/custom-blocks.html)
141+
## SFC의 커스텀 블록 통합하기 {#sfc-custom-block-integrations}
148142

149143
커스텀 블록은 다른 리퀘스트 쿼리로 가져온 동일한 Vue 파일로 컴파일 됩니다.
150144
이러한 가져오기 요청을 처리하는 것은 기본 빌드 도구에 달려 있습니다.
151145

152-
- Vite를 사용하는 경우, 일치하는 커스텀 블록을 실행 가능한 JavaScript로 변환하려면 커스텀 Vite 플러그인을 사용해야 합니다. [예제](https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-transforming-custom-blocks)
146+
- Vite를 사용하는 경우,
147+
일치하는 커스텀 블록을 실행 가능한 JavaScript로 변환하려면,
148+
커스텀 Vite 플러그인을 사용해야 합니다. [예제](https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-transforming-custom-blocks)
153149

154-
- Vue CLI 또는 일반 웹팩을 사용하는 경우, 일치하는 블록을 변환하도록 웹팩 로더를 구성해야 합니다. [예제](https://vue-loader.vuejs.org/guide/custom-blocks.html)
150+
- Vue CLI 또는 일반 웹팩을 사용하는 경우,
151+
일치하는 블록을 변환하도록 웹팩 로더를 구성해야 합니다. [예제](https://vue-loader.vuejs.org/guide/custom-blocks.html)
155152

156153
## 저수준 패키지 {#lower-level-packages}
157154

0 commit comments

Comments
 (0)