antd自定義組件初始值沒有返回或者設置initialValue,form.validateFields不會執行驗證

在自定義組件中加個componentDidMount返回初始值就可以啦

  componentDidMount() {
        const { onChange } = this.props;
        onChange({
            ...this.state,
        });

    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章