Merged
Conversation
Contributor
정상적인 es modules 방식이에요. |
Contributor
|
커밋로그는 제대로 좀 하셔야 할 듯 |
crongro
approved these changes
Feb 13, 2020
Contributor
crongro
left a comment
There was a problem hiding this comment.
UI코드들이 역할도 명확하고, 간결해서 좋네요.
여기까지 승인합니다.
다름 PR을 보내주세요~
| <link rel="stylesheet" href="./src/style/style.css" /> | ||
| <script src="./src/js/index.js" type="module"></script> | ||
| </head> | ||
| <body> |
| @@ -0,0 +1,47 @@ | |||
| const DATA = { | |||
| const card = new MainUI(DATA); | ||
| document.querySelector('#card').innerHTML = card.render(); | ||
|
|
||
| const slider = new Slider({ |
Contributor
There was a problem hiding this comment.
변경이 될 소지가 있는 클래스명과 아이디를 넘겨주는 거 좋아요!
| this.itemEl = document.querySelector(option.itemEl); | ||
| this.prevEl = document.querySelector(option.prevEl); | ||
| this.nextEl = document.querySelector(option.nextEl); | ||
| this.run(); |
Contributor
There was a problem hiding this comment.
run보다는 init? 정도가 좀더 나을거 같음.
| this.run(); | ||
| } | ||
| initStyle() { | ||
| const CLONE_NUMBER = 2; |
| onNextClick() { | ||
| this.nextEl.addEventListener('click', () => { | ||
| if (this.CURRUNT_INDEX === this.itemsEl.length + this.VIEW) return; | ||
| this.contentsEl.addEventListener('transitionend', () => { |
Contributor
There was a problem hiding this comment.
이렇게 중첩된 구조로 코드를 표현하니 보기 어렵네요.
보기좋게 개선을 해보시죠. 함수분리라던가..
| } | ||
| onNavClick() { | ||
| const INIT_ADD_NUMBER = 1; | ||
| for (const iterator of this.navLiEl) { |
| onNavIndex() { | ||
| console.log('NAV INDEX => ', this.CURRUNT_INDEX); | ||
| } | ||
| run() { |
Contributor
There was a problem hiding this comment.
run 이름은 별로지만, 아래 5개 호출을 모아둔건 좋네요.
| constructor(properties) { | ||
| this.properties = properties; | ||
| } | ||
| render() { |
| for (const list of iterator.list) { | ||
| itemList += `<li>${list}</li>`; | ||
| } | ||
| items += ` |
Contributor
There was a problem hiding this comment.
template literal 사용이 좋네요.
html코드가 길어지더라도 여기에 표현하는게 좀더 나은거 같고요. 이녀석이 view역할이라서..
물론 이걸 분리해서 별도 파일에 모아두는 것도 가능하죠.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://baekcode.github.io/codesquad-FE/day2/index.html
정신 없이 하다보니 미션 step1~2를 같이 해버렸습니다.
궁금 사항 :
미션 :
[스켈레톤 코드 :: 작업 진행]