轮播图无法切换
来源:7-4 Vue项目首页 - 首页轮播图
慕少0288913
2019-09-09
//HomeSwiper.Vue
<template>
<swiper :options="swiperOption">
<!-- slides -->
<swiper-slide>I'm Slide 1</swiper-slide>
<swiper-slide>I'm Slide 2</swiper-slide>
<swiper-slide>I'm Slide 3</swiper-slide>
<swiper-slide>I'm Slide 4</swiper-slide>
<swiper-slide>I'm Slide 5</swiper-slide>
<swiper-slide>I'm Slide 6</swiper-slide>
<swiper-slide>I'm Slide 7</swiper-slide>
<!-- Optional controls -->
<div class="swiper-pagination" slot="pagination"></div>
<div class="swiper-button-prev" slot="button-prev"></div>
<div class="swiper-button-next" slot="button-next"></div>
<div class="swiper-scrollbar" slot="scrollbar"></div>
</swiper>
</template>
<script>
export default {
name: "HomeSwiper",
data() {
return {
swiperOption: {}
};
}
};
</script>
//Home.Vue
<template>
<div>
<home-header></home-header>
<home-swiper></home-swiper>
</div>
</template>
<script>
import HomeHeader from "./components/Header";
import HomeSwiper from "./components/Swiper";
export default {
components: { HomeHeader, HomeSwiper }
};
</script>
//main.js
import Vue from 'vue'
import App from './App'
import router from './router'
import fastClick from 'fastclick' //解决移动端300ms点击延迟
import VueAwesomeSwiper from 'vue-awesome-swiper' //引入轮播插件
import 'styles/reset.css'//引入样式初始化文件
import 'styles/border.css'//解决移动端1px边框问题
import 'styles/iconfont.css'//引入iconfont
import 'swiper/dist/css/swiper.css'
写回答
2回答
-
努力的小猪猪
2019-11-01
同学你解决了吗
022020-02-19 -
Dell
2019-09-09
你看下你swiper的版本号,是否和我的版本号一致
0102020-02-22
相似问题
轮播图无法滑动
回答 1
浏览器在手机预览模式下,轮播图无法滑动
回答 1