ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.54k stars 2.38k forks source link

Button 怎麼設置吸底? #6470

Closed s1410422008 closed 7 months ago

s1410422008 commented 7 months ago

Version of antd-mobile

5.33.0

Description

我在官方的 Figma 設計檔中有看到 7.吸底按鈕,認知是內容滾動時,按鈕可以固定在下方,但我找不到官方實作說明,想問這個功能該如何實現? 2023-12-07_15-42

zombieJ commented 7 months ago

吸底是组合按钮的布局设计,不是组件的属性,你在实现的时候直接用样式就行了哈:

<div style={{ position: 'fixed', left: 0, right: 0, bottom:0, padding: 16 }}>
  <Button block ... />
</div>

如果是滚动吸附也可以考虑使用 Sticky 样式~