React轮播react-slick组件

2021-03-24372次阅读React

React轮播react-slick组件。

import React from "react";
import ReactDOM from "react-dom";
import Slider from "react-slick";
import "./index.css";

class ReactSlickDemo extends React.Component {
  render() {
    var settings = {
      dots: true
    };
    return (
      <div className="container">
        <Slider {...settings}>
          <div>
            <img src="http://placekitten.com/g/400/200" />
          </div>
          <div>
            <img src="http://placekitten.com/g/400/200" />
          </div>
          <div>
            <img src="http://placekitten.com/g/400/200" />
          </div>
          <div>
            <img src="http://placekitten.com/g/400/200" />
          </div>
        </Slider>
      </div>
    );
  }
}

ReactDOM.render(<ReactSlickDemo />, document.getElementById("container"));

演示一:https://react-slick.neostack.com/

演示二:https://codesandbox.io/s/ppwkk5l6xx

上一篇: react-intl实现React组件国际化  下一篇: @rollup/plugin-image导入JPG、PNG、GIF、SVG和WebP文件的rollup插件  

React轮播react-slick组件相关文章