VBoxLayout.jsx

This commit is contained in:
tengge1 2019-05-06 21:02:22 +08:00
parent 6275ef60db
commit 6fe59cdc78
6 changed files with 34 additions and 4 deletions

View File

@ -17,6 +17,13 @@ body,
flex-direction: row;
}
/* VBoxLayout */
.VBox {
display: flex;
flex-direction: column;
}
/* Panel */
.Panel {

View File

@ -31,7 +31,7 @@
region: 'center',
key: 3
});
var layout = React.createElement(Shadow.HBoxLayout, undefined, [
var layout = React.createElement(Shadow.VBoxLayout, undefined, [
panel1,
panel2,
panel3,

View File

@ -3,6 +3,7 @@ export { default as Button } from './form/Button.jsx';
// layout
export { default as HBoxLayout } from './layout/HBoxLayout.jsx';
export { default as VBoxLayout } from './layout/VBoxLayout.jsx';
// panel
export { default as Panel } from './panel/Panel.jsx';

View File

@ -1,5 +1,11 @@
import classNames from 'classnames/bind';
/**
* 水平布局
* @author tengge / https://github.com/tengge1
* @property {String} className 样式类
* @property {String} children 内容
*/
class HBoxLayout extends React.Component {
render() {
const { className, children } = this.props;

View File

@ -0,0 +1,17 @@
import classNames from 'classnames/bind';
/**
* 竖直布局
* @author tengge / https://github.com/tengge1
* @property {String} className 样式类
* @property {String} children 内容
*/
class VBoxLayout extends React.Component {
render() {
const { className, children } = this.props;
return <div className={classNames('VBox', className)}>{children}</div>;
}
}
export default VBoxLayout;

View File

@ -5,14 +5,13 @@ import classNames from 'classnames/bind';
* @author tengge / https://github.com/tengge1
* @property {String} title 标题
* @property {String} className 样式类
* @property {String} region 在BorderLayout中的位置west, east, north, south
* @property {String} children 内容
*/
class Panel extends React.Component {
render() {
const { title, className, region, children } = this.props;
const { title, className, children } = this.props;
return <div className={classNames('Panel', region, className)}>
return <div className={classNames('Panel', className)}>
<div className="wrap">
<div className="title">
<div className="icon">