我实际上是在 React-Admin 中编写一个容器来使用我存储在数据库中的照片,并在轮播中显示它们。
所以我的代码看起来像:
import get_two from ./get_two
const CarouselField = ({ source, record = {}}) =>
<div>
<Carousel {...{width: '220px',
height: '110px',
wrapAround: true,
renderBottomCenterControls: false}}>
<img src={get_two(source, record)[0]}/>
</Carousel>
</div>;
所以当我进入页面时,图像正在工作,但是当我进入另一个页面时,它说 get_two 是未定义的。