@connect(({ editnews,global, loading }) => ({ global,
editnews,
loading: loading.models.editnews,
timeLoading: loading.effects['editnews/getCollections'],
}))componentDidMount() {
message.warning("請修改參數點擊搜索,篩選展示數據!",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貢獻1909條經驗 獲得超7個贊
在一個組件中 state
或props
改變 都會執行render
方法,可能是因為你的其他數據發生了改變;
如果不想執行render
方法,可以在 shouldComponentUpdate
方法中進行判斷,return false
就可以阻止render
,這也是react官方推薦的解決方案。
添加回答
舉報
0/150
提交
取消