Skip to content

Commit a77e4c5

Browse files
committed
3.4.0
1. 新增forceRender属性 2. lazyMount重命名为lazy 3. 细节调整
1 parent 271831e commit a77e4c5

File tree

12 files changed

+175
-153
lines changed

12 files changed

+175
-153
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ interface PopupProps {
4040
style?: React.CSSProperties;
4141
className?: string;
4242
rootClassName?: string;
43-
rootStyle: React.CSSProperties;
44-
rootProps: React.HTMLAttributes<any>;
43+
rootStyle?: React.CSSProperties;
44+
rootProps?: React.HTMLAttributes<any>;
4545

4646
fixed?: boolean;
4747
visible: boolean;
48-
lazyMount?: boolean;
48+
lazy?: boolean;
49+
forceRender?: boolean;
50+
4951
//http://reactcommunity.org/react-transition-group/css-transition
5052
transition?: CSSTransitionProps;
5153
destroyOnClose?: boolean;
@@ -77,7 +79,7 @@ interface PopupProps {
7779
rootClassName: "",
7880

7981
fixed: false,
80-
lazyMount: true,
82+
lazy: true,
8183
transition: {},
8284
destroyOnClose: true,
8385

docs/asset-manifest.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/index.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/static/css/index.1ee6b54d.chunk.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/static/js/2.02e6097b.chunk.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/static/js/index.1ee6b54d.chunk.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/static/js/runtime-index.70097ef2.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/Demo.js

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
1-
import React, { Component } from 'react';
2-
import DemoList from './DemoList';
1+
import React, { Component } from "react";
2+
import DemoList from "./DemoList";
33

44
export default class Demo extends Component {
5+
state = {
6+
current: DemoList[0],
7+
};
58

6-
state = {
7-
current: DemoList[0]
8-
}
9+
onDemoChange(item, e) {
10+
this.setState({
11+
current: item,
12+
});
13+
}
914

10-
onDemoChange(item, e) {
11-
this.setState({
12-
current: item
13-
});
14-
}
15-
16-
render() {
17-
const { current } = this.state;
18-
return (
19-
<div className="container">
20-
<div className="slider">
21-
{
22-
DemoList.map((item, i) => {
23-
return (
24-
<div
25-
className={current === item ? 'active' : ''}
26-
onClick={this.onDemoChange.bind(this, item)}
27-
>
28-
{item.label}
29-
</div>
30-
);
31-
})
32-
}
33-
</div>
34-
<div className="content">
35-
{current ? <current.component /> : null}
36-
</div>
37-
</div>
38-
)
39-
}
40-
}
15+
render() {
16+
const { current } = this.state;
17+
return (
18+
<div className="container">
19+
<div className="slider">
20+
{DemoList.map((item, i) => {
21+
return (
22+
<div
23+
key={i}
24+
className={current === item ? "active" : ""}
25+
onClick={this.onDemoChange.bind(this, item)}
26+
>
27+
{item.label}
28+
</div>
29+
);
30+
})}
31+
</div>
32+
<div className="content">{current ? <current.component /> : null}</div>
33+
</div>
34+
);
35+
}
36+
}

examples/demos/demo4.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const maskAnimateClassNames = {
2626
export default class DEMO extends Component {
2727
state = {
2828
visible: true,
29-
mask: true,
29+
mask: false,
3030
};
3131

3232
toggleClick = e => {
@@ -46,6 +46,8 @@ export default class DEMO extends Component {
4646
render() {
4747
const { visible, mask } = this.state;
4848

49+
console.log(mask, "render");
50+
4951
return (
5052
<Fragment>
5153
<div>
@@ -65,6 +67,7 @@ export default class DEMO extends Component {
6567
<Popup
6668
visible={visible}
6769
mask={mask}
70+
lazy={false}
6871
destroyOnClose={true}
6972
style={{
7073
background: "#ff5454",
@@ -84,6 +87,7 @@ export default class DEMO extends Component {
8487
this.toggleClick2();
8588
},
8689
}}
90+
destroyOnClose={false}
8791
fixed
8892
>
8993
<div>fixed test</div>

0 commit comments

Comments
 (0)