鍍金池/ 問答/HTML/ 子組件接收父組件的參數(shù),怎么獲取父組件的參數(shù)

子組件接收父組件的參數(shù),怎么獲取父組件的參數(shù)

已經(jīng)解決了,在render里this.props.可以獲取到

render() {
        const continueVisible = this.props.continueVisible;
        return (
        ...
回答
編輯回答
掛念你

你已經(jīng)用了redux了,為什么還要這么麻煩。你把要傳遞給子組件的狀態(tài)放在store上傳遞下去,子組件就會自動根據(jù)數(shù)據(jù)進(jìn)行渲染了。state在組件控制自己本身的狀態(tài)的時(shí)候再使用。

2018年2月20日 06:26
編輯回答
壞脾滊

已經(jīng)解決了,在render里直接this.props可以獲得

render() {

    const continueVisible = this.props.continueVisible;
    return (
    ....
2018年1月4日 18:50