index.js
538 Bytes
import React, { Component } from 'react';
import { Button } from 'antd';
import { connect } from 'dva';
import styles from './style.less';
// TODO: Page 修改为有意义的名称
@connect(({ page }) => page)
class Page extends Component {
componentDidMount() {
const { dispatch } = this.props;
dispatch({
type: 'page/fetch',
});
}
render() {
const { text } = this.props;
return (
<div className={styles.container}>
<Button>{text}</Button>
</div>
);
}
}
export default Page;