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}>
);
}
}

  

react-custom-scrollbars的使用的更多相关文章

  1. how to create react custom hooks with arguments

    how to create react custom hooks with arguments React Hooks & Custom Hooks // reusable custom ho ...

  2. react第三方库

    作者:慕课网链接:https://www.zhihu.com/question/59073695/answer/1071631250来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...

  3. iScroll.js 用法参考 (share)

    分享是传播.学习知识最好的方法 以下这篇文章是iScroll.js官网的中文翻译,尽管自己英文不好,但觉得原作者们翻译的这个资料还是可以的,基本用法介绍清楚了.如果你英文比较好的话,可以看看官网的资料 ...

  4. iscroll4框架解析[webapp开发](转)

    概要 iScroll 4 这个版本完全重写了iScroll这个框架的原始代码.这个项目的产生完全是因为移动版webkit浏览器(诸如iPhone,iPad,Android 这些系统上广泛使用)提供了一 ...

  5. iScroll相关

    iScroll是一款用于移动设备web开发的一款插件.像缩放.下拉刷新.滑动切换等移动应用上常见的一些效果都可以轻松实现. iScroll的最新版本是2011.07.03发布的4.1.7版.最新版比以 ...

  6. iScroll.js 用法参考

    本文原文链接:http://www.cnblogs.com/duanhuajian/archive/2013/04/08/3008323.html 概要 iScroll 4 这个版本完全重写了iScr ...

  7. mCustomScrollbar的使用

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...

  8. 30款javascript脚本插件 jquery插件大全

      Shifty Nav - a Fully Responsive JS CSS3 Mega Menu Show Demo Shifty Nav is a fully responsive CSS3 ...

  9. iScroll 4.2.5 中文API

    概况 资料来源 http://cubiq.org/iscroll-4 http://www.cnblogs.com/wanghun/archive/2012/10/17/2727416.html ht ...

  10. iScroll.js插件使用方法

    iScroll.js 用法参考 (share) 分享是传播.学习知识最好的方法 以下这篇文章是iScroll.js官网的中文翻译,尽管自己英文不好,但觉得原作者们翻译的这个资料还是可以的,基本用法介绍 ...

随机推荐

  1. HOW TO: Setting up Encrypted Communications Channels in Oracle Databas

    access_timeSeptember 22, 2015 person_outlineMartin Rakhmanov share In this article, I will explain h ...

  2. emacs 帮助相关命令

    emacs 帮助相关命令 如下表: No. 键盘操作 键盘操作对应的函数 回答的问题 01 ctrl-h c describe-key-briefly 这个按键组合将运行哪个函数 02 ctrl-h ...

  3. Nginx 配置高可用的集群

    1.什么是 nginx 高可用 (1)需要两台 nginx 服务器 (2)需要 keepalived (3)需要虚拟 ip 2.配置高可用的准备工作 (1)需要两台服务器 192.168.17.129 ...

  4. 7. Go语言—时间模块

    一.时间模块 1. 统计程序执行时间 package main import ( "time" "fmt" ) func test() { time.Sleep ...

  5. nm U -l库的

    nm U -l库的

  6. Git仓库占用空间太大的解决方法

    git gc --aggressive对本地git库进行更彻底清理和优化,这个指令花费的时间也会更长. 胡云飞系统部署搭建整体把控:git gc --auto这是一个设置的指令,并不会进行gc操作.如 ...

  7. 第六章 HTTP首部

    第六章 HTTP首部 HTTP首部包括:请求行<方法,URI,版本号>/响应行<版本,状态码>.请求/响应首部字段.通用首部字段.实体首部字段 1.HTTP首部字段 HTTP首 ...

  8. ASP.NET开发实战——(十三)ASP.NET MVC 与数据库之EF实体类与数据库结构

    大家都知道在关系型数据库中每张表的每个字段都会有自己的属性,如:数据类型.长度.是否为空.主外键.索引以及表与表之间的关系.但对于C#编写的类来说,它的属性只有一个数据类型和类与类之间的关系,但是在M ...

  9. CodeForces - 545CWoodcutters

    传送门 题目大意:n棵树(10^5),坐标xi,高度hi,把这棵树砍到,可以向右倒[xi,xi+hi]被占, 向左倒[xi-hi,xi]被占,必须要倒的坐标没有被占才能倒,不砍倒就xi被占,问最多砍几 ...

  10. 01 学习数据分析的python库

    网页爬取 1.requests 2.BeautifulSoup 3.Scrapy 科学计算与数据分析 1.scipy 2.numpy 3.pandas 机器学习和深度学习 1.Scikit-learn ...