[React Swiper] import css 안될 때

2023. 4. 13. 21:56·Frontend/React

공식문서에 보면 get started 에서 css import하는 방식을

  // import Swiper and modules styles
  import 'swiper/css';
  import 'swiper/css/navigation';
  import 'swiper/css/pagination';

위와 같이 작성하면 된다고 적혀있는데 

 

이상하게 위와 같이 import하면 안된다?

이유는 나도 모르겠다...

 

해결방법은

import "swiper/swiper-bundle.css";

 

이렇게 import하면 잘된다!!

 

 

 

공식문서

get started

https://swiperjs.com/get-started

 

Getting Started With Swiper

Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.

swiperjs.com

css

https://swiperjs.com/swiper-api#css-styles

 

Swiper API

Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.

swiperjs.com

 

반응형

'Frontend > React' 카테고리의 다른 글

[React Chart] 리액트 chart.js tooltip custom 하기  (1) 2023.04.24
[React Swiper] loop={true} 마지막 페이지 먼저보이는 에러  (0) 2023.04.13
[React Swiper] play, stop 버튼 만들기  (1) 2023.04.13
[React Swiper] 리액트에서 스와이퍼 사용하기  (0) 2023.04.13
[React] 리액트 순위 매기기 만들기 (ranking)  (0) 2023.02.26
'Frontend/React' 카테고리의 다른 글
  • [React Chart] 리액트 chart.js tooltip custom 하기
  • [React Swiper] loop={true} 마지막 페이지 먼저보이는 에러
  • [React Swiper] play, stop 버튼 만들기
  • [React Swiper] 리액트에서 스와이퍼 사용하기
전예방
전예방
  • 전예방
    예방이의 개발일기
    전예방
  • 전체
    오늘
    어제
    • All (125)
      • Info & Tip (2)
      • 유용한 사이트들 (5)
      • Mark Up & StyleSheet (23)
        • HTML (6)
        • CSS & SCSS (10)
        • 반응형 (6)
      • Frontend (66)
        • 전체 (10)
        • JavaScript & Jquery (18)
        • TypeScript (0)
        • React (26)
        • Next.js (3)
        • 성능최적화 (2)
        • 웹접근성 (2)
      • Backend (13)
        • Python (1)
        • JAVA (2)
        • node.js (0)
        • PHP (7)
        • 패키지매니저 (3)
      • Markdown (0)
      • SCM (1)
        • Git&Github (1)
        • SVN (0)
      • IDE (4)
        • VSCode (2)
        • IntelliJ (1)
        • Ecplise (1)
      • 취미생활 (3)
      • 정보처리기사 (2)
      • 코딩자율학습단 (5)
        • 12기 (파이썬) (5)
  • 블로그 메뉴

    • 홈
    • 태그
  • 링크

    • velog
    • github
  • 공지사항

  • 인기 글

  • 태그

    React Swiper
    php
    TypeScript
    Python
    frontend
    react
    swiper.js
    Chart.js
    코딩자율학습단
    NPM
    파이썬
    회원가입
    관리자 페이지
    Admin
    나도코딩
    코딩자율학습
    CSS
    반응형
    yarn berry
    리액트
  • 최근 댓글

  • 최근 글

  • 반응형
  • hELLO· Designed By정상우.v4.10.3
전예방
[React Swiper] import css 안될 때
상단으로

티스토리툴바