React-select,当鼠标悬停在一个选项上时,打开子菜单。

问题描述 投票:0回答:1

我想用React-select在主菜单内建立一个子菜单,应该是这样的。

Text

当把鼠标悬停在主菜单的某个选项上时 它会触发子菜单在旁边打开。

有什么方法可以用react-select来实现这个功能吗?我找不到这方面的例子或文档,有没有类似```optionOnMouseover```这样的函数?先谢谢你!

const options = [
  { value: 'chocolate', label: 'Chocolate' },
  { value: 'strawberry', label: 'Strawberry' },
  { value: 'vanilla', label: 'Vanilla' },
];
...

<Select
    value={...}
    onChange={...}
    options={options}
 />```

reactjs react-select
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.