mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:19:01 +08:00
修复轮播图 options 可能不是数组的报错
This commit is contained in:
parent
19df5bdf5b
commit
bf5dc5420f
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user