-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[10기 이연권] TodoList with CRUD #209
base: dalcon10028
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
내 코드 리뷰
|
||
new TodoInput({ | ||
$app, | ||
addTodo: (inputValue) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state를 App.js에서 모두 관리하기 위한 과정에서 하위컴포넌트의 이벤트에 대한 함수가 길어지는 것 같습니다.
@@ -0,0 +1,18 @@ | |||
export default class TodoInput { | |||
constructor({ $app, addTodo }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원하는 인자명을 정확하게 받기위해서 객체 형태로 작성했는데 다른 방식도 고려해보거나 다른 표기 방식을 고려해보는 것도 좋을 것 같습니다.
|
||
this.$todolist.addEventListener('click', ({ target }) => { | ||
if (target.className === 'toggle') { | ||
toggleTodo(Number(target.closest('li').dataset.id)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중복된 코드 Number(target.closest('li').dataset.id
를 변수로 따로 빼서 줄이면 더 좋을 것 같습니다.
import TodoList from './components/TodoList.js'; | ||
import TodoCount from './components/TodoCount.js'; | ||
|
||
import { ALL, ACTIVE, COMPLETED } from "./constants/todoState.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드 경로의 문자열이 컨벤션을 맞춰서 quotes로 작성해야될 것 같습니다.
🚀 미션
🎯 요구사항
todo list에 todoItem을 키보드로 입력하여 추가하기
todo list의 체크박스를 클릭하여 complete 상태로 변경. (li tag 에 completed class 추가, input 태그에 checked 속성 추가)
todo list의 x버튼을 이용해서 해당 엘리먼트를 삭제
todo list를 더블클릭했을 때 input 모드로 변경. (li tag 에 editing class 추가) 단 이때 수정을 완료하지 않은 상태에서 esc키를 누르면 수정되지 않은 채로 다시 view 모드로 복귀
todo list의 item갯수를 count한 갯수를 리스트의 하단에 보여주기
todo list의 상태값을 확인하여, 해야할 일과, 완료한 일을 클릭하면 해당 상태의 아이템만 보여주기
🎯🎯 심화 요구사항
localStorage에 데이터를 저장하여, TodoItem의 CRUD를 반영하기. 따라서 새로고침하여도 저장된 데이터를 확인할 수 있어야 함