首页 > 解决方案 > 菜单出现和消失,过渡效果

问题描述

当我按下菜单更改语言时,如何获得菜单出现和消失的效果?如图所示:https://wieldy.g-axon.work/main/dashboard/crypto

在这里演示:https ://stackblitz.com/edit/react-bagqa9

import Select from 'react-select'

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

class App extends Component {
  constructor() {
    super();
    this.state = {
      name: 'React'
    };
  }

  render() {
    return (
      <Select 
      options={options} 
      classNamePrefix='my-className-prefix' 
      />
    );
  }
}

标签: javascriptcssreactjsreact-select

解决方案


React Select 使用可用于覆盖现有 css 的覆盖值。您需要找到弹出框的 CSS 值并使用关键帧来获取该动画。


推荐阅读