Skip to content
This repository was archived by the owner on Jan 12, 2020. It is now read-only.
This repository was archived by the owner on Jan 12, 2020. It is now read-only.

wepy自带的connect太难用 #16

@kaiyuanlee

Description

@kaiyuanlee

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展开了

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions