1.先用AntD的图标来当做轮播图点击的两个按钮,并将Carousel与按钮放在一个父级下。
轮播图切换按钮
(this.slider = el)}>
1
2
3
4
2.轮播图的配置lunboSetting写法
const lunboSetting = {
dots: true,
lazyLoad: true,
autoplay:true
};
3.轮播图两个切换函数
constructor(props) {
super(props);
this.next = this.next.bind(this);
this.prev = this.prev.bind(this);
}
next() {
this.slider.slick.slickNext();
}
prev() {
this.slider.slick.slickPrev();
}
整个页面代码
import React, {Component} from 'react';
import {Carousel, Input, Tabs, Icon} from 'antd';
class Hom