WingBlank 两翼留白

布局控件

代码演示

基本

<WingBlank size='md'>…</WingBlank>

  1. import { WingBlank, WhiteSpace } from 'antd-mobile';
  2. const PlaceHolder = ({ className = '', ...restProps }) => (
  3. <div className={`${className} placeholder`} {...restProps}>Block</div>
  4. );
  5. const WingBlankExample = () => (
  6. <div style={{ padding: '15px 0' }}>
  7. <WingBlank><PlaceHolder /></WingBlank>
  8. <WhiteSpace size="lg" />
  9. <WingBlank size="md"><PlaceHolder /></WingBlank>
  10. <WhiteSpace size="lg" />
  11. <WingBlank size="sm"><PlaceHolder /></WingBlank>
  12. </div>
  13. );
  14. ReactDOM.render(<WingBlankExample />, mountNode);
  1. .placeholder {
  2. background-color: #ebebef;
  3. color: #bbb;
  4. text-align: center;
  5. height: 30px;
  6. line-height: 30px;
  7. width: 100%;
  8. }

WingBlank两翼留白 - 图1

API

属性说明类型默认值
size两翼留白的间距,可选sm,md,lgstringlg