@ozo/react-rock
Version:
React 移动端开发脚手架,基于CRA3,通用、开箱即用。
25 lines (23 loc) • 599 B
JSX
import React from 'react';
import styles from './WingBlank.module.scss';
/**
* 左右留白距离
*
* @param {*} props 组件参数 padWidth:左右留白距离num
* @returns 组件
*/
function WingBlank(props) {
// 左右留白距离
const { className, style, padWidth, children } = props;
const styleObj = {
paddingLeft: `${padWidth}px`,
paddingRight: `${padWidth}px`,
...style,
};
return (
<div className={`${styles.wingBlank} ${className || ''}`} style={styleObj}>
{children}
</div>
);
}
export default WingBlank;