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
Copy file name to clipboardExpand all lines: content/tutorial/03-sveltekit/06-forms/05-customizing-use-enhance/README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
-
title: Customizing use:enhance
2
+
title: use:enhance 커스터마이징하기
3
3
---
4
4
5
-
With `use:enhance`, we can go further than just emulating the browser's native behaviour. By providing a callback, we can add things like **pending states**and**optimistic UI**. Let's simulate a slow network by adding an artificial delay to our two actions:
5
+
`use:enhance`를 이용하면 브라우저의 기본 동작을 에뮬레이션하는 것보다 더 많은 일을 할 수 있습니다. 콜백을 제공함으로써 **대기 상태**및**낙관적 UI**와 같은 기능을 추가할 수 있습니다. 두 액션에 인위적인 지연을 추가하여 느린 네트워크를 시뮬레이션해 봅시다.
6
6
7
7
```js
8
8
/// file: src/routes/+page.server.js
@@ -19,7 +19,7 @@ export const actions = {
19
19
};
20
20
```
21
21
22
-
When we create or delete items, it now takes a full second before the UI updates, leaving the user wondering if they messed up somehow. To solve that, add some local state...
22
+
항목을 생성하거나 삭제할 때, UI가 업데이트되기까지 1초가 걸리므로 사용자가 혼란스러워할 수 있습니다. 이를 해결하기 위해 로컬 상태를 추가합시다.
23
23
24
24
```svelte
25
25
/// file: src/routes/+page.svelte
@@ -35,7 +35,7 @@ When we create or delete items, it now takes a full second before the UI updates
35
35
</script>
36
36
```
37
37
38
-
...and toggle `creating` inside the first `use:enhance`:
38
+
그리고 첫 번째 `use:enhance` 안에서 `creating`을 토글합시다.
39
39
40
40
```svelte
41
41
/// file: src/routes/+page.svelte
@@ -64,7 +64,7 @@ When we create or delete items, it now takes a full second before the UI updates
64
64
</form>
65
65
```
66
66
67
-
We can then show a message while we're saving data:
67
+
그러고 나면 데이터를 저장하는 동안 메시지를 표시할 수 있습니다.
68
68
69
69
```svelte
70
70
/// file: src/routes/+page.svelte
@@ -77,7 +77,7 @@ We can then show a message while we're saving data:
77
77
{/if}+++
78
78
```
79
79
80
-
In the case of deletions, we don't really need to wait for the server to validate anything — we can just update the UI immediately:
80
+
삭제의 경우, 서버가 무언가를 검증하기를 기다릴 필요가 없이 바로 UI를 업데이트할 수 있습니다.
81
81
82
82
```svelte
83
83
/// file: src/routes/+page.svelte
@@ -105,4 +105,4 @@ In the case of deletions, we don't really need to wait for the server to validat
105
105
</ul>
106
106
```
107
107
108
-
> `use:enhance` is very customizable — you can `cancel()` submissions, handle redirects, control whether the form is reset, and so on. [See the docs](https://kit.svelte.dev/docs/modules#$app-forms-enhance) for full details.
108
+
> `use:enhance`는 아주 다양하게 사용 가능합니다. 제출을 `cancel()`하거나, 리디렉션을 처리하고, 폼의 리셋 여부를 제어하는 등의 작업을 할 수 있습니다. [문서](https://kit.svelte.dev/docs/modules#$app-forms-enhance)에서 자세한 내용을 확인하세요.
0 commit comments