vuex, router로 영화 앱 만들기 예제
// index.js export default new Vuex.Store({ state: { movies: { dunkirk: { id: 'dunkirk', title: 'Dunkirk', subtitle: 'Dunkirk', description: `Miraculous evacuation of Allied soldiers from Belgium, Britain, Canada, and France, who were cut off and surrounded by the German army from the beaches and harbor of Dunkirk, France, during the Battle of France in World War II.`, largeImgSrc: `url('https:/..
2020. 1. 6.
DocumentFragment
var $box = $('#box'); var arr = ['a','b','c','d','e','f']; arr.forEach( item => { $box.append( '' + item + '' ); }); 위와 같은 방식으로 배열 등을 받아와서 동적으로 태그를 추가해주는 방식은 양이 적으면 상관없겠지만 그 양이 수백, 수천개라면 성능에도 좋지 않고 그만큼 페이지를 새로 그려야합니다. 브라우저가 힘들어할겁니다. var $box = $('#box'); var arr = ['a','b','c','d','e','f']; var $frag = $(document.createDocumentFragment()); arr.forEach( item => { $frag.append( '' + item + '' ); }..
2019. 12. 20.