Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task
limingxxoo opened this issue Feb 3, 2024 · 6 comments
Open
1 task

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

limingxxoo opened this issue Feb 3, 2024 · 6 comments

Comments

@limingxxoo
Copy link

limingxxoo commented Feb 3, 2024

Basic Info

  • Package Name And Version: @arco-design/mobile-react@2.30.7
  • Phone Model And Version: iphone
@limingxxoo limingxxoo changed the title Picker组件开户cascade联动,实际不联动 Picker组件开启cascade联动,实际不联动 Feb 3, 2024
@limingxxoo
Copy link
Author

微信截图_20240203112200

<Cell.Group bordered={false}> <Cell label="Choose a location" showArrow onClick={() => { setVisible(true); }} > {pickerValue.join("-")} </Cell> </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
Copy link
Author

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

"react": "^18.2.0",
"react-dom": "^18.2.0",
"@arco-design/mobile-react": "^2.30.7",

@TinaPeach
Copy link
Collaborator

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

@limingxxoo
Copy link
Author

@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
Copy link
Collaborator

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

@Tsionhe
Copy link

Tsionhe commented Sep 12, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants