@connect(({ editnews,global, loading }) => ({ global,
editnews,
loading: loading.models.editnews,
timeLoading: loading.effects['editnews/getCollections'],
}))componentDidMount() {
message.warning("請修改參數(shù)點(diǎn)擊搜索,篩選展示數(shù)據(jù)!",10)
const { dispatch} = this.props;
dispatch({ type: 'editnews/getCollections',
payload: {}
});
}render() { const {
editnews: { data, data: { pagination }, collections },
loading,
timeLoading,
} = this.props;
console.log(pagination)
2 回答

jeck貓
TA貢獻(xiàn)1909條經(jīng)驗(yàn) 獲得超7個贊
在一個組件中 state
或props
改變 都會執(zhí)行render
方法,可能是因?yàn)槟愕钠渌麛?shù)據(jù)發(fā)生了改變;
如果不想執(zhí)行render
方法,可以在 shouldComponentUpdate
方法中進(jìn)行判斷,return false
就可以阻止render
,這也是react官方推薦的解決方案。
添加回答
舉報(bào)
0/150
提交
取消