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

eg-drop-down

v0.2.0

Published

drop-down for react pc app

Downloads

8

Readme

eg-drop-down

使用react构建pc端应用的下拉菜单解决方案,配合eagle-ui将使界面和功能更完善

DropDownMenu 渲染单层下拉列表

DropDownSelect 渲染单层下拉单选框

DropDownSuggestion 渲染联想词下拉框

MultiDropDownMenu has removed to eg-drop-tree ,use npm install eg-drop-tree instead


code example(代码示例)

    import {DropDownMenu, DropDownSelect,DropDownSuggestion} from "../../src/index.js";//联想功能组件
    export default class IndexModule extends Component {
        constructor(props,context){
            super(props,context);
        }
        render(){
            var bu = [
                {id: 1,name: "交易后台"},
                {id: 2,name: "结婚1"}];
            let menuData=[
                { data:'近一个周的问题',callback:()=>{alert('clicked')}},
                { data:'近一个月的问题',callback:()=>{alert('clicked')}},
                { data:'一个月之前的问题',callback:()=>{alert('clicked')}}];
            return (
                <div className="paddingSpace">   
                    <div style={{fontSize:'12px',display:'inline-block',width:'200px'}}>
                        <DropDownMenu  dropDownData={menuData} title='单层下拉列表'/>
                    </div>
                    <div style={{fontSize:'12px',display:'inline-block',width:'200px'}}>
                        <DropDownSelect  dropDownData={bu} title='下拉选择框' ref="DropDownSelect"/>
                    </div>
                    <div style={{fontSize:'12px',display:'inline-block',width:'200px',verticalAlign:'top'}}>
                        <DropDownSuggestion url={'/package.json'} placeHolder='下拉联想框' ref="DropDownSuggestion"/>
                    </div>
                    <div className='demo-button-container'>
                        <div className='demo-button' style={{background:'yellow'}} onClick={()=>{this.getDropDownData("DropDownSelect")}}>点击获得下拉选择框的选择数据</div>
                        <div className='demo-button' style={{background:'blue'}} onClick={()=>{this.getDropDownData('DropDownSuggestion')}}>点击获取下拉联想框的选择数据</div>
                    </div>
                </div>
            );
        }
        getDropDownData(type){
            alert(JSON.stringify(this.refs[type].formData));
        }
    }
    render(<IndexModule/>,document.getElementById('root'));

UI展示

普通下拉单选和展示 普通下拉单选和展示

instructions[使用方式]

请参考example/src/index.js文件

download(下载)

    #usage
        npm install eg-drop-down
	#demo
	    npm run demo