在安裝vue-awesome-swiper時報錯swiper/dist/css/swiper.min.css找不到,如下如:
有的回答安裝6.0版本的話需要引入另外一個css
import 'swiper/swiper-bundle.css'
但是,我替換完css 之后又一個問題出現了,vue-awesome-swiper組件pagination小圓點不顯示,並且左右兩側的小圖標也沒有,也不報錯。
找來找去發現是swiper的版本太高的問題導致的。
於是卸載已經安裝的swiper
卸載完成之后會有如下提示:
提示需要swiper@^5.2.0的版本
重新安裝swiper@^5.2.0之后就合適了。
即,此時需要執行如下命令安裝與vue-awesome-swiper 4.1.1對應版本的另一個第三方插件swiper5.2.0:
卸載當前Swiper
:npm uninstall swiper
安裝低版本的Swiper
:npm install swiper@5.2.0 -S
參考鏈接:
1、vue引入新版vue-awesome-swiper報錯問題處理
2、解決vue-awesome-swiper中swiper/css/swiper.css無法導入問題
3、vue-awesome-swiper swiper/dist/css/swiper.css 報not found錯誤