dzh-react-sticky
Version:
React中固钉(粘性布局)组件实现
32 lines (25 loc) • 757 B
Markdown
React中固钉(粘性布局)组件实现
| Property | Type | Required? | Description |
| ------------- | ------ | --------- | ---------------------------- |
| contentHeight | Number | ✓ | 被固钉组件包裹起来的内容高度 |
```react
import React, { Component } from 'react'
import { Sticky } from 'dzh-react-sticky'
class Example extends Component {
render()(
return <div>
...
<Sticky contentHeight={40}>
{% 被固钉组件包裹起来的子组件 %}
<Filter />
</Sticky>
...
</div>
)
}
```
*dzh-react-sticky* is available under the MIT License.