npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bee-dropdown

v2.0.14

Published

dropdown ui component for react

Downloads

401

Readme

bee-dropdown

npm version Build Status Coverage Status devDependency Status NPM downloads

浏览器支持

|IE | Chrome | Firefox | Opera | Safari| | --- | --- | --- | --- | --- | | 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|传递给弹出菜单的className|string|''| |align|对齐方式|object|{}| |overlayStyle|传递给弹出菜单的style|object|{}| |onVisibleChange|下拉菜单显示与否的钩子函数|function|() => {}| |showAction|显示时的钩子函数数组|array|[]| |hideAction|隐藏时的钩子函数数组|array|[]| |getPopupContainer|获取要添加的容器|function|默认是body| |getDocument|点击隐藏的容器,适用于出现iframe的情况|function|document| |disabled|是否禁用|bool|false| |delay|延迟显示隐藏时间,单位毫秒|number|-| |delayShow|延迟显示时间,单位毫秒|number|-| |delayHide|延迟隐藏时间,单位毫秒|number|-| |minOverlayWidthMatchTrigger|是否设置下拉的最小宽度|bool|true|

开发调试

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