(转)Cannot resolve “swiper/dist/css/swiper.css” from “项目路径\swiper\dist\css\swiper.css”
程序员文章站
2022-07-15 12:46:21
...
- 修改nuxt.config.js如下:
plugins: [
{ src: '~/plugins/nuxt-swiper-plugin.js', ssr: false }
],
css: [
'swiper/css/swiper.css'
]
- 修改nuxt-swiper-plugin.js如下:
import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper/dist/vue-awesome-swiper.js'
Vue.use(VueAwesomeSwiper)