Closed YUNH7 closed 1 year ago
import Carousel from '../components/Carousel';
import SomeCard from '../components/SomeCard';
const carouselSettings = { // 캐러셀 세팅
slidesPerView: 1, // 한 번에 보일 요소 개수
spaceBetween: 12, // 요소 사이 갭 px
breakpoints: { // 반응형
480: { // 480px 이상일 때
spaceBetween: 24,
slidesPerView: 1.5,
},
768: {
spaceBetween: 36,
slidesPerView: 2.5,
},
},
};
return (
<Carousel
settings={carouselSettings} // 세팅객체
dataArr={Card에 뿌려줄 데이터 배열}
Card={SomeCard} // 데이터(dataArr의 요소)를 담을 카드 컴포넌트
/>
)
넘길 프롭스react-slick에서 swiper로 변경 아래 댓글 봐주세요(23.06.07)1. 캐러셀 세팅 객체(참고 https://react-slick.neostack.com/docs/api)2. 자식 요소 간격(ex. 0, 1rem, 10px ..)~~3. 자식 요소 ** 개별 자식 요소 만들 때className="slider-item"
부여해주세요!~~ 안해도되게 수정했습니다(23.06.04)