Open limingxxoo opened 9 months ago
`
{pickerValue.join("-")} </Cell.Group> <Picker ref={pickerRef} visible={visible} cascade={true} data={data} maskClosable={true} hideEmptyCols={true} onHide={() => { console.log( "------cell status", pickerRef.current.getCellMovingStatus() ); setVisible(false); }} onOk={(value) => { console.log("on ok", value); setPickerValue(value); }} onPickerChange={() => { if (pickerRef.current) { console.info( "-----demo getAllColumnValues", pickerRef.current.getAllColumnValues() ); } }} value={pickerValue} cols={3} needBottomOffset={true} />`
开启联动cascade选项不联动,
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@arco-design/mobile-react": "^2.30.7",
@limingxxoo 同学,传给Picker组件的data
属性值发下?
@limingxxoo 同学,传给Picker组件的
data
属性值发下?
就是组件演示文档里的数据,
const data = [{ label: 'Beijing', value: 'Beijing', children: [{ label: 'Beijing', value: 'Beijing', }] } , { label: 'Liaoning', value: 'Liaoning', children: [{ label: 'Shenyang', value: 'Shenyang', children: [{ label: 'Shenhe', value: 'Shenhe' }, { label: 'Hunnan', value: 'Hunnan' }, { label: 'Shenbei', value: 'Shenbei' } ] }, { label: 'Benxi', value: 'Benxi', children: [{ label: 'Xihu', value: 'Xihu' }, { label: 'Dongming', value: 'Dongming' }, { label: 'Huanren', value: 'Huanren' } ] }] }, { label: 'Yunnan', value: 'Yunnan', children: [{ label: 'Kunming', value: 'Kunming', children: [{ label: 'Wuhua', value: 'Wuhua' }, { label: 'Guandu', value: 'Guandu' }, { label: 'Chenggong', value: 'Chenggong' }] }] }, ];
@limingxxoo 跟demo一样的代码,用react18没有复现,https://arco.design/mobile/react/arco-design/mobile/#/components/picker 看看这个级联选择在你那边能够复现吗?
遇到一样的问题,直接复制demo的代码,级联选择无效
Basic Info