arco-design / arco-design-mobile

React mobile UI components library based on Arco Design
https://arco.design/mobile/react/arco-design/pc/#/
MIT License
419 stars 77 forks source link

Picker组件开启cascade联动,实际不联动 #228

Open limingxxoo opened 9 months ago

limingxxoo commented 9 months ago

Basic Info

limingxxoo commented 9 months ago

微信截图_20240203112200

` <Cell label="Choose a location" showArrow onClick={() => { setVisible(true); }}

{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} />`

limingxxoo commented 9 months ago

IMG_4482 开启联动cascade选项不联动,

"react": "^18.2.0",
"react-dom": "^18.2.0",
"@arco-design/mobile-react": "^2.30.7",
TinaPeach commented 9 months ago

@limingxxoo 同学,传给Picker组件的data属性值发下?

limingxxoo commented 9 months ago

@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' }] }] }, ];

TinaPeach commented 9 months ago

@limingxxoo 跟demo一样的代码,用react18没有复现,https://arco.design/mobile/react/arco-design/mobile/#/components/picker 看看这个级联选择在你那边能够复现吗?

Tsionhe commented 2 months ago

遇到一样的问题,直接复制demo的代码,级联选择无效