Vue----swiper 引入swiper样式报错npm install --save swiper/dist/css/swiper.css

npm install swiper vue-awesome-swiper

在main.js里引入import 'swiper/dist/css/swiper.css',会报错npm install --save swiper/dist/css/swiper.css

查看swiper版本,高于6.0.0需import 'swiper/swiper-bundle.css'方式引入样式;

低于6.0.0 import 'swiper/css/swiper.css'引入样式

基本解决vue引入swiper会报错的原因

你可能感兴趣的:(Vue----swiper 引入swiper样式报错npm install --save swiper/dist/css/swiper.css)