Swiper: how import swipere.css

Created on 9 Aug 2018  路  1Comment  路  Source: nolimits4web/swiper

  1. i npm install swiper
    npm install swiper

  2. webpack.config.js modules
    { test : /\.js$/, exclude : /node_modules\/(?!(dom7|ssr-window|swiper)\/).*/, use : { loader: "babel-loader?presets[]=es2015" } }

  3. entry js file
    import Swiper from 'swiper'; var mySwiper = new Swiper('.menu-left', { freeMode : true, slidesPerView : 'auto', freeModeSticky : true, });

swiper.js loaded, but swiper.css how import? import form node_modules in entry js file?
import '../node_moudes/swiper/dis/css/swiper.css

Most helpful comment

If you are using webpack, you can import directly like this:

import Swiper from 'swiper'    
import 'swiper/dist/css/swiper.css'

>All comments

If you are using webpack, you can import directly like this:

import Swiper from 'swiper'    
import 'swiper/dist/css/swiper.css'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

QJan84 picture QJan84  路  3Comments

cristianfierro picture cristianfierro  路  4Comments

magic-77 picture magic-77  路  3Comments

aeblin picture aeblin  路  3Comments

RyanGosden picture RyanGosden  路  3Comments