전체 글 (12) 썸네일형 리스트형 webOS: web app 개발일지(5) 지난 번에 이어서 calendar를 마저 보았다. onSelectChange = (data) => { this.setMonth(data.data);// reset dataContext this.props.onMonthChange && this.props.onMonthChange(); }; SelectList = (props) => { let popup = props.data.map((data) => { // return mapped array return ( { this.onSelectChange(e, data); // change dataContext if clicked }}> {data} ); }); return ( // return popup array {popup} ); }; onSelectCha.. webOS: web app 개발일지(4) react life cycle에 대해 간단히 정리했다. mount : 처음 render되고 component 생성 및 DOM 적용 constructor() / static getDerivedStateFromProps() / render() / componentDidMount() update : props, state re-render static getDerivedStateFromProps() / shouldComponentUpdate() / render() / getSnapshotBeforeUpdate() / componentDidUpdate() unmount : component DOM 제거 componentWillUnmount() Calendar.js를 마저 살펴보자. 1) import import.. webOS: web app 개발일지(3) 공식 홈페이지에 의하면 web app을 만들 때 다음 세 개의 파일은 반드시 필요하다. appinfo.json : metadata icon.png : icon image file index.html : main page appinfo.json은 앞서 한 번 살펴봤고, 이제 icon.png와 index.html을 살펴보자 2. icon.png 사실 이건 별로 살펴 볼 필요가 없다. 이렇게 생긴 아이콘 png 파일 세 개가 크기 별로 저장되어 있다. 3. index.html 기본적으로 index.html을 시작으로 web app이 만들어지게 되지만 위 앱은 enact 기반으로 만들어져서 구성이 좀 다르다. 실제 앱을 제작할 때 enact를 활용할 생각은 아직 없어서 간단하게 구조만 알아보았는데, 기본적으로 .. 이전 1 2 3 4 다음