Antd 级联下拉列表

react : code:

const { Cascader } = antd;
let bannain=[{value:'h1',label:'h1'},{value:'h2',label:'h2'}]
let months=[{value:01,label:'一月'},{value:02,label:'二月'}]
let years=[]
let month=[]
for(let i=0;i<100;i++){
  years[i]={value:i+2000,label:i+2000,children:bannain}
  month[i]={value:i+2000,label:i+2000,children:months}
}
let niandu={value:'年度',label:'年度',children:years};
let yuedu={value:'月度',label:'月度',children:month};
const options = [niandu,yuedu,{
  value: '年度',
  label: '年度',
  children: [{
    value: 'hangzhou',
    label: 'Hangzhou',
    
  }],
}, {
  value: 'jiangsu',
  label: 'Jiangsu',
  children: [{
    value: 'nanjing',
    label: 'Nanjing',
    children: [{
      value: 'zhonghuamen',
      label: 'Zhong Hua Men',
    }],
  }],
}];

function onChange(value) {
  console.log(value);
}

ReactDOM.render(
  ,
  mountNode
);

 

你可能感兴趣的:(Antd)