Skip to content

link-team/mini-sticky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mini-sticky

A sticky pollyfill for mini-program.

API

属性 说明 类型 默认值 必选
scrollTop 实时传入的滚动条卷起高度 number null true
top 固定时距离顶部高度 number 0 false
className 类名,用于定义样式 string null false

Usage

$ npm install mini-sticky -S
"usingComponents": {
    "sticky": "mini-sticky/es/sticky/index"
  }
<sticky scrollTop="{{scrollTop}}" className="sticky" top="0">
  <view style="height: 40px; line-height: 40px; background: #eee; width: 100vw; text-align: center">这个是sticky</view>
  <view style="height: 40px; line-height: 40px; background: #eee; width: 100vw; text-align: center" slot="stick-faker">这个是sticky</view>
</sticky>