react react-lazyload 懒加载列表

import LazyLoad from "react-lazyload";

function Placeholder() {
  return <img src={catJpg} />;
}

        <ul>
          {this.images.map(el => (
            <li key={el.id} >
                <LazyLoad once={true} placeholder={<Placeholder />} >
                  <img src={el.img} />
                </LazyLoad>
            </li>
          ))}
        </ul>
posted @ 2018-12-21 21:59  Ajanuw  阅读(620)  评论(0)    收藏  举报