mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
canonical style
This commit is contained in:
parent
fee00e3841
commit
af5cde61d1
@ -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}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user