0

我已经使用react-native-picker-select并尝试禁用所选项目以显示除它之外。我试过下面的代码,但没有运气。任何人都可以解决这个问题吗?

示例代码:

import RNPickerSelect from 'react-native-picker-select';

export const Dropdown = () => {
    return (
        <RNPickerSelect
            onValueChange={(value) => console.log(value)}
            items={[
                { label: 'Football', value: 'football' },
                { label: 'Baseball', value: 'baseball', disabled: true }, // Item need to disable
                { label: 'Hockey', value: 'hockey' },
            ]}
        />
    );
};

预期:我想禁用所选项目。

4

0 回答 0