tnt-lazy-load
v1.0.3
Published
react 图片懒加载组件
Downloads
3
Readme
react 图片懒加载组件
#Development npm i && npm test
#Usage
var TntLazyLoad = require('tnt-lazy-load');
var React = require('react');
var ReactDOM = require('react-dom');
ReactDOM.render(<TntLazyLoad
src={'http://s00.qccr.com/qccr/g00/backend/2017/02/79edf7bfde9cefed.png'}
/> , document.getElementById('app'));
#API
##props
| name | type | default | description |
| offset | number | 100 | 触发距离 |
| src | string | | 图片地址 |
| placeholderW | string/number | 100 | 默认图片宽 |
| placeholderH | string/number | 100 | 默认图片高 |
| placeholder | string | | 默认图片地址 |
| alt | string | | 图片描述 |
| style | object | {} | 组件容器样式 |
| onChange | function(val:element) | | 替换图片回调 |