Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bee-autocomplete

Package Overview
Dependencies
Maintainers
14
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bee-autocomplete

AutoComplete ui component for react

  • 2.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
14
Created
Source

bee-auto-complete

npm version Build Status Coverage Status devDependency Status NPM downloads Average time to resolve an issue Percentage of issues still open

react bee-auto-complete component for tinper-bee

根据用户的输入,进行自动匹配显示列表,用户可以进行按需选择自己需要的内容在输入框展示

使用方法

class Demo1 extends Component {
    constructor(props) {
        super(props);
        this.state = {
            value: "",
            options: ['10000(博宇)', '10001(波波)', '10002(李刚)'],
            placeholder: "查找关键字,请输入1",
            disabled: false
        }
        this.onFormChange = this.onFormChange.bind(this);
    }
    onFormChange(value) {
        this.setState({
            value: value
        })

    }
    render() {
        let { value, options, placeholder,disabled} = this.state;
        return (
            <div className="demo" style={{ "marginBottom": "90px" }}>
                <AutoComplete
                    value={value}
                    disabled={disabled}
                    options={options}
                    placeholder={placeholder}
                    onValueChange={value => this.onFormChange(value)}
                />

            </div>
        )
    }
}

API

参数说明类型默认值
value传入的输入框的值any-
options自动匹配列表array[]
placeholder输入框的默认提示string-
show控制自动匹配列表的展开和隐藏booleanfalse
disabled是否禁用输入框booleanfalse
onChange输入框值更改时触发的回调函数function-
onValueChange输入框值更改时触发的回调函数function-
onKeyDown监听input的键盘事件,调用此函数handleKeyDown()-
onBlurinput 的失去焦点时,调用此函数function-
onSelectOption被选中时调用,参数为选中项的 value 值function-
开发调试
$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-auto-complete
$ cd bee-auto-complete
$ npm install
$ npm run dev

Keywords

FAQs

Package last updated on 24 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc