修复轮播图 options 可能不是数组的报错

This commit is contained in:
liaoxuezhi 2019-07-11 00:42:56 +08:00
parent 19df5bdf5b
commit bf5dc5420f

View File

@ -78,7 +78,7 @@ export class Carousel extends React.Component<CarouselProps, CarouselState> {
controlsTheme: 'light',
animation: 'fade',
controls: ['dots', 'arrows'],
placeholder: ''
placeholder: '-'
};
state = {
@ -255,7 +255,7 @@ export class Carousel extends React.Component<CarouselProps, CarouselState> {
const [dots, arrows] = [controls.indexOf('dots') > -1, controls.indexOf('arrows') > -1];
const animationName = nextAnimation || animation;
if (options && options.length) {
if (Array.isArray(options) && options.length) {
body = (
<div
ref={this.wrapperRef}