nuxt使用swiper
1. 安装vue-awesome-swiper
npm install vue-awesome-swiper --save
这条命令结束之后可能会有警告
npm WARN vue-awesome-swiper@4.1.1 requires a peer of swiper@^5.2.0 but none is installed. You must install peer dependencies yourself.
如果出现警告,需安装swiper@^5.2.0
npm install swiper@^5.2.0 --save
2. 安装完成之后,在plugins文件夹下新建一个swiper.js文件
import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'
Vue.use(VueAwesomeSwiper)
3. 在nuxt.config.js内引入
css: [
'element-ui/lib/theme-chalk/index.css',
'swiper/css/swiper.mi