react-custom-scrollbars的作用

  1. 流畅的本机浏览器滚动
  2. 移动设备的本机滚动条
  3. 完全可定制
  4. 自动隐藏
  5. 自动高度
  6. 通用(在客户端和服务器上运行)
  7. requestAnimationFrame 60fps
  8. 没有多余的样式表
  9. 经过良好测试,代码覆盖率100%

安装

npm install react-custom-scrollbars --save    

基本用法

import { Scrollbars } from 'react-custom-scrollbars';
class App extends Component {
render() {
return (
<Scrollbars style={{ width: 500, height: 300 }}>
<p>Some great content...</p>
</Scrollbars>
);
}
}  

 可配置:

import { Scrollbars } from 'react-custom-scrollbars';

class CustomScrollbars extends Component {
render() {
return (
<Scrollbars
onScroll={this.handleScroll}
onScrollFrame={this.handleScrollFrame}
onScrollStart={this.handleScrollStart}
onScrollStop={this.handleScrollStop}
onUpdate={this.handleUpdate}
renderView={this.renderView}
renderTrackHorizontal={this.renderTrackHorizontal}
renderTrackVertical={this.renderTrackVertical}
renderThumbHorizontal={this.renderThumbHorizontal}
renderThumbVertical={this.renderThumbVertical}
autoHide
autoHideTimeout={1000}
autoHideDuration={200}
autoHeight
autoHeightMin={0}
autoHeightMax={200}
thumbMinSize={30}
universal={true}
{...this.props}>
);
}
}

  

最新文章

  1. javascript动画系列第二篇——磁性吸附
  2. LR Socket 测试demo
  3. android 的通知管理
  4. 23种设计模式学习一(单列模式)singleton
  5. XML DTD验证
  6. POJ 1795
  7. spring aop通过joinpoint传递参数
  8. PL/SQL在Oracle服务器上连接出错
  9. Android解析Json速度最快的库:json-smart
  10. zoj 3620 Escape Time II
  11. Ubuntu下安装Hudson
  12. 【Android Studio安装部署系列】二十、Android studio如何将so文件添加到svn中
  13. PPT vba从Execl 拷贝图表
  14. JS学习笔记Day3
  15. 域渗透分析神器BloodHound
  16. dubbo系列五、dubbo核心配置
  17. JS中JSON.parse和eval的异同
  18. Merkle Tree 概念
  19. asyncsocket的用法
  20. c++多个文件中如何共用一个全局变量

热门文章

  1. Dynamics CRM 客户端程序开发:在实体的列表界面添加按钮
  2. PHP代码篇(七)--PHP及MySQL已经使用过的函数
  3. [视频教程] redis中的bit运用统计用户在线天数
  4. ntp服务设置开机自启动失败
  5. centos 的系统管理命令 service systemctl
  6. 自己整理的模拟爬虫的user-agent
  7. 【转】Redis常见面试题
  8. lua 12 table 的使用
  9. angular跳转和传参
  10. go 学习笔记之环境搭建