mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-05 05:18:34 +08:00
修复轮播图 options 可能不是数组的报错
This commit is contained in:
parent
842fd8d284
commit
7e57452d55
@ -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