🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

bee-dropdown

Package Overview
Dependencies
Maintainers
17
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bee-dropdown

dropdown ui component for react

latest
Source
npmnpm
Version
2.0.14
Version published
Maintainers
17
Created
Source

bee-dropdown

npm version Build Status Coverage Status devDependency Status NPM downloads

浏览器支持

IEChromeFirefoxOperaSafari
IE 9+ ✔Chrome 31.0+ ✔Firefox 31.0+ ✔Opera 30.0+ ✔Safari 7.0+ ✔

下拉列表组件

使用方法

先进行下载bee-button包

npm install --save bee-dropdown

import Dropdown from 'bee-dropdown';
import Button from 'bee-button';
import Menu, { MenuItem } from 'bee-menus';

class Demo extends Component {
   render () {

       const menu = (
             <Menu multiple>
               <MenuItem key="1">借款合同</MenuItem>
               <MenuItem key="2">抵/质押合同</MenuItem>
               <MenuItem key="3">担保合同</MenuItem>
               <MenuItem key="4">联保合同</MenuItem>
               <MenuItem key="5">合同审批</MenuItem>
               <MenuItem key="6">抵/质押合同跟踪</MenuItem>
             </Menu>
         );
       return (
            <Dropdown
                trigger={['click']}
                overlay={menu}
                animation="slide-up">
                <Button colors='primary'>点击显示</Button>
            </Dropdown>
       )
   }
}

样式引入

  • 可以使用link引入build目录下Dropdown.css
<link rel="stylesheet" href="./node_modules/bee-dropdown/build/Dropdown.css">
  • 可以在js中import样式
import "./node_modules/bee-dropdown/src/Dropdown.scss"
//或是
import "./node_modules/bee-dropdown/build/Dropdown.css"

API

参数说明类型默认值
transitionName下拉显示动画--
trigger触发的事件数组array['hover']
placement触发的位置支持bottomLeft/bottomCenter/bottomRight/topLeft/topCenter/topRight'bottomLeft'
overlay要显示的菜单element/reactComponent-
animation触发时的动画string-
overlayClassName传递给弹出菜单的classNamestring''
align对齐方式object{}
overlayStyle传递给弹出菜单的styleobject{}
onVisibleChange下拉菜单显示与否的钩子函数function() => {}
showAction显示时的钩子函数数组array[]
hideAction隐藏时的钩子函数数组array[]
getPopupContainer获取要添加的容器function默认是body
getDocument点击隐藏的容器,适用于出现iframe的情况functiondocument
disabled是否禁用boolfalse
delay延迟显示隐藏时间,单位毫秒number-
delayShow延迟显示时间,单位毫秒number-
delayHide延迟隐藏时间,单位毫秒number-
minOverlayWidthMatchTrigger是否设置下拉的最小宽度booltrue

开发调试

$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-dropdown
$ cd bee-dropdown
$ npm install
$ npm run dev

Keywords

react

FAQs

Package last updated on 17 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts