Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
cómo hacer la verificación nula cuando se usa Cascader en FormItem

Estoy usando Cascader en antd 3.x así:

 <Row gutter={16} justify="start"> <Col xs={24} sm={12} md={12} lg={12} xl={8} xxl={7}> <FormItem style={{ marginLeft:20,marginTop: 18,width:'100%'}} label="所属地区"> {getFieldDecorator('orgArea', { initialValue: '', rules: [{ required: true,message:'所属地区必填' }], })( <this.LazyOptions/> )} </FormItem> </Col> </Row>

y esta es la definición de LazyOptions :

 LazyOptions = () => { const [options, setOptions] = React.useState(optionLists); const onChange = (value, selectedOptions) => { var unique = value.filter(this.onlyUnique); this.setState({ formValues:{ ...this.state.formValues, orgArea: unique.toString().replace(',','') } },()=>{ }); }; const loadData = selectedOptions => { const targetOption = selectedOptions[selectedOptions.length - 1]; targetOption.loading = true; // load options lazily setTimeout(() => { targetOption.loading = false; targetOption.children =regionDict.CITY[`${targetOption.label}`].map(function(itemc){ return ({ label: itemc, value: itemc, }); }); setOptions([...options]); }, 100); }; return <Cascader options={options} loadData={loadData} onChange={onChange} changeOnSelect style={{ width: 220 }}/>; };

este problema es cuando seleccioné el valor en Cascader , el validador FormItem todavía me dice que el valor es nulo. ¿Cómo hacer visible el valor seleccionado de Cascader en Cascader ?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!