1.1.0 • Published 6 years ago
@zhongyangxun/auto-complete v1.1.0
@zhongyangxun/auto-complete
A auto-complete component for react.
Qucik Start
installation
yarn add @zhongyangxun/auto-completeUsage
import React from 'react'
import AutoComplete from "@zhongyangxun/auto-complete";
const onSelect = () => {
console.log('select');
}
const onChange = () => {
console.log('change');
}
const App = () => {
const options = [
{
value: 'a',
},
{
value: 'b',
}
];
return (
<div className="app">
<AutoComplete
onChange={onChange}
onSelect={onSelect}
options={options}
/>
</div>
);
}
export default App;Document
options
value
The initial value of the auto-complete.
options
The drop down select list.
onSelect
Callback of the drop down select list selected.
onChange
Callback of change event.
onSearch
Callback of input event.
onFocus
Callback of focus event.
onBlur
Callback of blur event.