mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-15 22:49:07 +08:00
canonical style
This commit is contained in:
parent
fee00e3841
commit
af5cde61d1
@ -1,6 +1,6 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import RcDrawer from 'rc-drawer-menu';
|
import RcDrawer from 'rc-drawer-menu';
|
||||||
import { isNull } from 'util';
|
import { isNull, isNumber } from 'util';
|
||||||
|
|
||||||
type EventType =
|
type EventType =
|
||||||
| React.MouseEvent<HTMLDivElement>
|
| React.MouseEvent<HTMLDivElement>
|
||||||
@ -22,7 +22,7 @@ export interface IDrawerProps {
|
|||||||
// @todo 下一步增加
|
// @todo 下一步增加
|
||||||
zIndex?: number;
|
zIndex?: number;
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
placement?: 'left' | 'right' ;
|
placement?: 'left' | 'right';
|
||||||
onClose?: (e: EventType) => void;
|
onClose?: (e: EventType) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,14 +96,20 @@ export default class Drawer extends React.Component<
|
|||||||
}
|
}
|
||||||
const containerStyle = { width: this.props.width };
|
const containerStyle = { width: this.props.width };
|
||||||
return (
|
return (
|
||||||
<div style={containerStyle} >
|
<div style={containerStyle}>
|
||||||
{header}
|
{header}
|
||||||
{closer}
|
{closer}
|
||||||
<div className={`${prefixCls}-body`} style={this.props.style}>{this.props.children}</div>
|
<div className={`${prefixCls}-body`} style={this.props.style}>
|
||||||
</div >
|
{this.props.children}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
|
let { width } = this.props;
|
||||||
|
if (isNumber(width)) {
|
||||||
|
width = `${width}px`;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<RcDrawer
|
<RcDrawer
|
||||||
{...this.props}
|
{...this.props}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
@import "../../style/themes/default";
|
||||||
|
|
||||||
@dawer-prefix-cls: ~"@{ant-prefix}-drawer";
|
@dawer-prefix-cls: ~"@{ant-prefix}-drawer";
|
||||||
@ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86);
|
|
||||||
|
|
||||||
.@{dawer-prefix-cls} {
|
.@{dawer-prefix-cls} {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -9,7 +10,7 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
|
||||||
>* {
|
>* {
|
||||||
transition: all .3s @ease-in-out-circ;
|
transition: transform .3s @ease-in-out-circ;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-content-wrapper {
|
&-content-wrapper {
|
||||||
|
Loading…
Reference in New Issue
Block a user