import React from 'react'; import PropTypes from 'prop-types'; import ls from './Window.less' import Fa from "./Fa"; export default class Window extends React.Component { constructor({initWidth}) { super(); this.state = { width: initWidth } } render() { let {children, title, minimizable } = this.props; return
{title}
{minimizable && _}
{children}
} getStyle() { return { width: toPx(this.state.width), height: toPx(this.state.height), left: toPx(this.state.left), top: toPx(this.state.top) } } } Window.defaultProps = { minimizable: false, }; function toPx(val) { return val === undefined ? undefined : val + 'px'; }