javascript - 在 Reactstrap 不受控制的轮播组件中自定义图像样式
问题描述
我在使用 Reactstrap 中的不受控制的轮播组件时遇到了一些问题。除了为每张幻灯片上的图像设置样式外,我已经能够使用他们文档中的代码来让一切正常工作。我想使用叠加层使图像变暗以使文本突出。但是,我不熟悉如何使用他们的组件来做到这一点。在 Bootstrap 中,将自定义类应用于标签非常容易。因为 Reactstrap Carousel 只访问原始数组中的图像,所以我不能应用相同的自定义类。有没有其他方法可以解决这个问题?
const TESTIMONIES = [
{
src: './img/mcphersons.jpg',
header: ' ',
caption: "Caption 1",
key: '1'
},
{
src: './img/hootons.jpeg',
header: ' ',
caption: "Caption 2",
key: '2'
},
{
src: './img/berlangas.JPG',
header: ' ',
caption: "Caption 3",
key: '3'
}
];
const Carousel = () => (
<Row className='mt-5 mb-5'>
<Col md={8} className="mx-auto">
<UncontrolledCarousel items={TESTIMONIES} />
</Col>
</Row>
);
export default Carousel;
解决方案
推荐阅读
- reactjs - React Styleguidist - Web 组件未加载到 index.html
- c - 在声明/编译时带有参数的 C 函数指针
- extjs - extjs 绑定公式
- android - 在 RecyclerView 中将文本换行到下一行
- ansible - 在 Ansible 中使用来自 CDH 的 Hadoop
- python - 如何在python中正确解码窗口路径
- angular - Angular 9:同一组件上的解析器和服务
- sql-server - 根据日历ID加入最新记录
- r - 在目录中找不到文件,找不到文件
- c# - 使用 Microsoft Graph API 更新 Excel 命名范围中的值