1.要在各种语言中预制中文
2.router中配置路由
注意:在这里404必须放在最后,不然页面显示就是404
3.pages
import React, { PureComponent } from 'react';
import { connect } from 'dva';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';
@connect(({ test }) => ({
test
}))
class Test extends PureComponent {
componentDidMount() {
const { dispatch } = this.props;
dispatch({
type: 'test/fetch',
});
}
render() {
const {test}=this.props;
const {count}=test;
return (
<PageHeaderWrapper title="测试页">
<div>
{count}
</div>
</PageHeaderWrapper>
);
}
}
export default Test;