We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在业务模块和组件中可以随意使用远程接口完成异步请求
类似 Dva 中声明 models 和 services 并关联后使用 this.props.dispatch
models
services
this.props.dispatch
The text was updated successfully, but these errors were encountered:
/** * 获取所有年级 * @param params * @return {Promise.<Object>} */ export async function getGrades(params) { return request({ url: '/api/common/getGrades', method: "POST", data: params.payload }); }
import ReactDOM from 'ReactDOM' import List from '../components/List.jsx'; import style from './index.css'; import * as service from '../services/indexServices'; ReactDOM.render(( <div className={style.hello}> <h1>Hello js-multi-seed!</h1> <List dispatch={service} /> </div> ), document.getElementById('main'));
/** * 获取年级数据 */ getGradesData = () => { this.props.dispatch.getGrades({ payload: { id: 123 } }).then((data) => { if (data) { this.setState({ data: data.returnEntity }); } }) };
Sorry, something went wrong.
No branches or pull requests
What problem does this feature solve?
在业务模块和组件中可以随意使用远程接口完成异步请求
What does the proposed API look like?
类似 Dva 中声明
models
和services
并关联后使用this.props.dispatch
The text was updated successfully, but these errors were encountered: