Skip to content

Commit 5808683

Browse files
bingoringViolet-Bora-Lee
authored andcommitted
[라이브 타이머] 과제 번역
본 PR은 [Custom elements]에 대한 과제 전체와 해답 전체에 대한 내용이 담겨있습니다.
1 parent 062bc61 commit 5808683

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

2-
Please note:
3-
1. We clear `setInterval` timer when the element is removed from the document. That's important, otherwise it continues ticking even if not needed any more. And the browser can't clear the memory from this element and referenced by it.
4-
2. We can access current date as `elem.date` property. All class methods and properties are naturally element methods and properties.
2+
두 가지 참고 사항이 있습니다.
3+
1. 요소가 문서에서 제거되면 `setInterval` 타이머도 지웁니다. 그러지 않으면 더 필요하지 않더라도 계속 tick 하므로 타이머를 지우는 것은 중요합니다. 그리고 `setInterval` 타이머를 지우지 않으면 브라우저는 요소의 메모리와 요소에 의해 참조된 메모리를 지우고 참조할 수 없습니다.
4+
2. 현재 날짜는 `elem.date` 프로퍼티로 접근할 수 있습니다. 당연히 모든 클래스 메서드와 프로퍼티는 요소 메서드와 프로퍼티입니다.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11

2-
# Live timer element
2+
# 라이브 타이머 요소
33

4-
We already have `<time-formatted>` element to show a nicely formatted time.
4+
잘 구성된 시각을 표시하는 `<time-formatted>` 요소가 이미 있습니다.
55

6-
Create `<live-timer>` element to show the current time:
7-
1. It should use `<time-formatted>` internally, not duplicate its functionality.
8-
2. Ticks (updates) every second.
9-
3. For every tick, a custom event named `tick` should be generated, with the current date in `event.detail` (see chapter <info:dispatch-events>).
6+
현재 시간을 표기하기 위해 `<live-timer>`요소를 작성하세요.
7+
1. 내부적으로 `<time-formatted>`를 사용해야 하며 `<time-formatted>`의 기능을 똑같이 사용하지 않아야 합니다.
8+
2. 매초 tick을 업데이트하십시오.
9+
3. 모든 tick에 대해 `event.detail`에 현재 날짜와 함께 `tick`이라는 이름을 가진 사용자 정의 이벤트가 생성되어야 합니다(챕터 <info:dispatch-events> 참조).
1010

11-
Usage:
11+
사용법:
1212

1313
```html
1414
<live-timer id="elem"></live-timer>
@@ -18,6 +18,6 @@ Usage:
1818
</script>
1919
```
2020

21-
Demo:
21+
데모:
2222

2323
[iframe src="solution" height=40]

0 commit comments

Comments
 (0)