index.axml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <view class='page-container-classname' ref='saveChildRef0'>
  2. <demo-block title='基础用法' ref='saveChildRef1'>
  3. <van-sticky ref='saveChildRef2'>
  4. <van-button type='primary' custom-style='margin-left: 15px' ref='saveChildRef3'>
  5. 基础用法
  6. </van-button>
  7. </van-sticky>
  8. </demo-block>
  9. <demo-block title='吸顶距离' ref='saveChildRef4'>
  10. <van-sticky offset-top='{{ 50 }}' ref='saveChildRef5'>
  11. <van-button type='info' custom-style='margin-left: 115px' ref='saveChildRef6'>
  12. 吸顶距离
  13. </van-button>
  14. </van-sticky>
  15. </demo-block>
  16. <demo-block title='指定容器' ref='saveChildRef7'>
  17. <view id='container' style='height: 150px; background-color: #fff;'>
  18. <van-sticky container='{{ container }}' ref='saveChildRef8'>
  19. <van-button type='warning' custom-style='margin-left: 215px;' ref='saveChildRef9'>
  20. 指定容器
  21. </van-button>
  22. </van-sticky>
  23. </view>
  24. </demo-block>
  25. <demo-block title='嵌套在 scroll-view 内使用' ref='saveChildRef10'>
  26. <scroll-view scroll-y=" " id='scroller' style='height: 200px; background-color: #fff;' onScroll='onScroll'>
  27. <view style='height: 400px; padding-top: 50px;'>
  28. <van-sticky scroll-top='{{ scrollTop }}' offset-top='{{ offsetTop }}' ref='saveChildRef11'>
  29. <van-button type='warning' ref='saveChildRef12'>
  30. 嵌套在 scroll-view 内
  31. </van-button>
  32. </van-sticky>
  33. </view>
  34. </scroll-view>
  35. </demo-block>
  36. </view>