canonical style

This commit is contained in:
jim 2018-05-25 15:10:45 +08:00 committed by 陈帅
parent fee00e3841
commit af5cde61d1
2 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,6 @@
import * as React from 'react';
import RcDrawer from 'rc-drawer-menu';
import { isNull } from 'util';
import { isNull, isNumber } from 'util';
type EventType =
| React.MouseEvent<HTMLDivElement>
@ -22,7 +22,7 @@ export interface IDrawerProps {
// @todo 下一步增加
zIndex?: number;
prefixCls?: string;
placement?: 'left' | 'right' ;
placement?: 'left' | 'right';
onClose?: (e: EventType) => void;
}
@ -96,14 +96,20 @@ export default class Drawer extends React.Component<
}
const containerStyle = { width: this.props.width };
return (
<div style={containerStyle} >
<div style={containerStyle}>
{header}
{closer}
<div className={`${prefixCls}-body`} style={this.props.style}>{this.props.children}</div>
</div >
<div className={`${prefixCls}-body`} style={this.props.style}>
{this.props.children}
</div>
</div>
);
}
render() {
let { width } = this.props;
if (isNumber(width)) {
width = `${width}px`;
}
return (
<RcDrawer
{...this.props}

View File

@ -1,5 +1,6 @@
@import "../../style/themes/default";
@dawer-prefix-cls: ~"@{ant-prefix}-drawer";
@ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86);
.@{dawer-prefix-cls} {
position: fixed;
@ -9,7 +10,7 @@
pointer-events: none;
>* {
transition: all .3s @ease-in-out-circ;
transition: transform .3s @ease-in-out-circ;
}
&-content-wrapper {