UNPKG

@ttk/component

Version:

ttk组件库

51 lines (41 loc) 1.42 kB
import { _ as _extends } from '../extends-b1af4ff7.js'; import { _ as _defineProperty } from '../defineProperty-847730aa.js'; import { _ as _objectWithoutProperties } from '../objectWithoutProperties-0c3c7796.js'; import React__default from 'react'; import classNames from 'classnames'; import '../_commonjsHelpers-471920d6.js'; var _excluded = ["className", "style", "width", "height", "direction", "justifyContent", "alignItems"]; function LayoutComponent(props) { var className = props.className, style = props.style, width = props.width, height = props.height, direction = props.direction, justifyContent = props.justifyContent, alignItems = props.alignItems, others = _objectWithoutProperties(props, _excluded); className = classNames(_defineProperty({ 'mk-layout': true }, className, !!className)); style = style || {}; if (width) { //style.flex = `0 0 ${width}px` style.width = "".concat(width, "px"); } if (height) { //style.flex = `0 0 ${height}px` style.height = "".concat(height, "px"); } if (direction) { style.flexDirection = direction; } style.justifyContent = justifyContent; if (alignItems) { style.alignItems = alignItems; } return /*#__PURE__*/React__default.createElement("div", _extends({}, others, { className: className, style: style })); } export { LayoutComponent as default };