React轮播-----react-bootstrap

React项目 使用轮播图

React-bootstrap中的轮播(Carousel)模块
参考github: https://github.com/react-bootstrap/react-bootstrap

代码

  // 引入轮播模块
import {
    Carousel
} from "react-bootstrap";
// 引入图片
import image1 from "./image/image1.png";
import image2 from "./image/image2.png";

...

class Banner extends Component {
    
    render (){
     return (
         <div className="index-banner-region" style={{ height: height + "px" }}>
             <Carousel pauseOnHover={ false }>
                  <Carousel.Item>
                      <div className="w1000">
                          <img
                            alt="bannerText1"
                            src={ imag1 }
                          />
                      </div>
                  </Carousel.Item>
                  <Carousel.Item>
                      <div className="w1000">
                          <img
                            alt="bannerText1"
                            src={ imag2 }
                          />
                      </div>
                  </Carousel.Item>
            </Carousel>
        </div>
    )}
}
export default Banner;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,915评论 2 45
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 179,495评论 25 708
  • GCD -Grand Central Dispatch GCD包含于libdispatch.dylib,系统默认加...
    志城阅读 678评论 0 0
  • 今天这个时候,恰好是每一年的一天,人们赋予了它特殊的意义。我没有陪在孩子和笑妈的身边,而是出了远门。 在这个520...
    羽翼成阅读 576评论 0 50
  • 微风轻轻吹过,本是轻柔,于我却是清冷,人间冷暖,不过心境而已。
    散央阅读 174评论 0 1

友情链接更多精彩内容