WhiteSpace 上下留白

布局控件

代码演示

基本

上下留白 <WhiteSpace size='md' />
  1. import { WhiteSpace } from 'antd-mobile';const PlaceHolder = ({ className = '', restProps }) => ( <div className={${className} placeholder} {…restProps}>Block</div>);const WhiteSpaceExample = () => ( <div> <WhiteSpace size="xs" /> <PlaceHolder /> <WhiteSpace size="sm" /> <PlaceHolder /> <WhiteSpace /> <PlaceHolder /> <WhiteSpace size="lg" /> <PlaceHolder /> <WhiteSpace size="xl" /> <PlaceHolder /> </div>);ReactDOM.render(<WhiteSpaceExample />, mountNode);
  1. .placeholder { background-color: #ebebef; color: #bbb; text-align: center; height: 30px; line-height: 30px; width: 100%;}
WhiteSpace上下留白 - 图1## API#
属性说明类型默认值
size上下留白的间距,可选xs,sm,md,lg,xlstringmd