@ozo/react-rock
Version:
React 移动端开发脚手架,基于CRA3,通用、开箱即用。
25 lines (23 loc) • 675 B
JSX
import React from 'react';
import styles from './WhiteSpace.module.scss';
/**
* 间距高度,分离上下距离
*
* @param {*} props 组件参数 height间距高度,number /默认10
* @returns 组件
*/
function WhiteSpace(props) {
// 行留白距离
const { className = '', height, noFirst, noLast } = props;
const styleObj = {
height: `${height}px`,
};
let tSpecClass = '';
if (noFirst) {
tSpecClass = styles.noFirst;
} else if (noLast) {
tSpecClass = styles.noLast;
}
return <div className={`${styles.whiteSpace} ${className} ${tSpecClass}`} style={height && styleObj} />;
}
export default WhiteSpace;