rc-anchor-scroll
介绍
基于react的锚点滚动组件
特性
安装
yarn add rc-anchor-scroll -S
or
npm add rc-anchor-scroll -S
如何使用
配置项
属性名 | 说明 | 类型 | 必填 | 默认值 |
---|
containerId | 容器ID | string | false | 'x-anchor-scroll' |
initActiveKey | 初始激活索引 | number | false | 0 |
children | 内容列表 | any[] | true | false |
className | 容器样式类名 | string | false | -- |
style | 容器行内样式 | React.CSSProperties | false | -- |
contentStyle | 内容区域行内样式 | React.CSSProperties | false | -- |
offsetTop | 滚动偏移量 | number | false | 0 |
onChange | 点击选择的tab | Function | false | -- |
navbarProps | navbar属性 | ScrollNavbarType | true | -- |
预览
移动端
![测试图片](https://i.postimg.cc/nhX2nQyX/yidong.gif)
PC端
![测试图片](https://i.postimg.cc/XvQYxpvg/pc.gif)
License
MIT