Skip to content
16 changes: 16 additions & 0 deletions src/core/Component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default class Component {
$target;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(질문) $로 변수명 시작하는 것이 다른 변수와 기능 상의 차이점이 있는지 아니면 이렇게 사용하는 것이 관습인지 궁금해요.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 기능상의 차이는 없습니다! 편의상 저렇게 많이 쓰시더라구요

props;

constructor($target, props) {
this.$target = $target;
this.props = props;
this.setState();
this.render();
this.bindEvents();
}

setState() {}
render() {}
bindEvents() {}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

처음부터 컴포넌트 단위로 설계를 하셔서 데이터를 저장하고, 보여주고, 컨트롤 하도록 MVC패턴에 기반해서 개발시도한 느낌이 들어요. 저도 다음에는 이렇게 시도해봐야 겠어요. 👍