UNPKG

887 BJavaScriptView Raw
1import React from 'react';
2import PubSub from 'pubsub-js';
3
4import { Layout } from 'antd';
5
6const {Content} = Layout;
7
8import Render from './render';
9
10
11export default class ContentView extends React.Component {
12
13 token;
14
15 constructor(props) {
16 super(props);
17
18 // var mySubscriber = ( msg, data ) => {
19 // this.refs.render.setPage(data);
20 // };
21
22 // this.token = PubSub.subscribe('SET_PAGE', mySubscriber );
23 }
24
25 componentWillUnmount() {
26 PubSub.unsubscribe(this.token);
27 }
28
29 render() {
30 console.log('================')
31 console.log(this.props.match);
32 const {match} = this.props;
33 return (
34 <Content style={{ background: '#fff', padding: 24, margin: 0, minHeight: 280 }}>
35 <Render ref='render' pageName={match.params.pageName}/>
36 </Content>
37 )
38 }
39}
\No newline at end of file