export default {
data(){
return {
currentPage: 'findMusic',
currentCut: 'discover',
}
},
name: 'home',
components: {
headTop
},
mounted(){
new Swiper('.swiper-container', {
loop: true,
autoplay: 3000,
autoHeight: true,
grabCursor: true,
prevButton: '.swiper-button-prev',
nextButton: '.swiper-button-next',
pagination: '.swiper-pagination',
});
}
}
import '../plugins/swiper-3.4.2.min.js'
import '../styles/swiper.min.css'
<div class='swiper-container'>
<div class='swiper-wrapper'>
<div class='swiper-slide'><img src='../assets/slide/slide1.jpg'/></div>
<div class='swiper-slide'><img src='../assets/slide/slide2.jpg'/></div>
<div class='swiper-slide'><img src='../assets/slide/slide3.jpg'/></div>
<div class='swiper-slide'><img src='../assets/slide/slide4.jpg'/></div>
<div class='swiper-slide'><img src='../assets/slide/slide5.jpg'/></div>
<div class='swiper-slide'><img src='../assets/slide/slide6.jpg'/></div>
</div>
<div class='swiper-pagination'></div>
<div class='swiper-button-prev swiper-prev'></div>
<div class='swiper-button-next swiper-next'></div>
</div>
网上搜索,说的是 import 和 module.export不能混用,可是我这里没有混用啊。。。晕,哪位大佬能帮下,拜谢
需要引入插件 babel-plugin-transform-es2015-modules-commonjs
然后在 .babelrc中配置 { "plugins": ["transform-es2015-modules-commonjs"] }
我的简书[https://www.jianshu.com/p/837...]