import { connect } from 'wepy-redux'
@connect({
ordersn: state => state.orderdetail.ordersn,
isLoading: state => state.orderdetail.isLoading,
loginStatus: state => state.global.loginStatus,
userInfo: state => state.global.userInfo,
})
而在dva里所有的这样写就完事了
import { connect } from 'react-redux'
@connect(({ orderdetail, global }) => ({ ...orderdetail, ...global }))
import { connect } from 'wepy-redux' @connect({ ordersn: state => state.orderdetail.ordersn, isLoading: state => state.orderdetail.isLoading, loginStatus: state => state.global.loginStatus, userInfo: state => state.global.userInfo, })
而在dva里所有的这样写就完事了
import { connect } from 'react-redux' @connect(({ orderdetail, global }) => ({ ...orderdetail, ...global }))
orderdetail和global是namespace
亲,有什么好的解决办法吗? 如果这个页面使用的state比较多,每一个都要定义一行,很繁琐,dva直接就把这个namespace展开了