账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    how the value of open in dropdown of react-bootstrap change?
    38
    0

    1,i read in the react - the source code of the bootstrap.But I feel very confused, the open value is how change?The following code

    dropdown.js
    Dropdown.propTypes = propTypes;
    Dropdown.defaultProps = defaultProps;
    setBsClass('dropdown', Dropdown);
    const UncontrolledDropdown = uncontrollable(Dropdown, { open: 'onToggle' });
    UncontrolledDropdown.Toggle = DropdownToggle;
    UncontrolledDropdown.Menu = DropdownMenu;
    export default UncontrolledDropdown;

    1
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 10 元积分
        全部回答
    • 0
    • In React Bootstrap, the value of the open prop in a dropdown component changes when the value of the selected prop changes. The selected prop determines whether the dropdown is open or closed. The open prop determines whether the dropdown is currently open or not. Here's an example of how the open prop works in a React Bootstrap dropdown component: ```javascript

      {selected === "option1" ? ( ) : ( )}

      ```

      In this example, the selected prop is set to "option1", which means the dropdown is currently open. The dropdown-menu component displays the options for "option1", and the selected prop determines whether the selected option is displayed or not. If selected is "option1", the dropdown-menu will display the ul element containing the li elements for "Link 1" and "Link 2". If selected is not "option1", the dropdown-menu will not display any options. The value of the open prop can also be set to false to close the dropdown. For example: ```javascript

      {selected === "option1" ? ( ) : ( )}

      ```

      In this example, the open prop is set to false, which means the dropdown is currently closed. The dropdown-menu component will not display any options, and the selected prop will not be used.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部