1.0.0 • Published 4 years ago

react-widget-input v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

Input

npm install --save react-widget-input

Api

Input

参数说明类型默认值
prefixCls组件CSS样式前缀stringrw-input
className组件className属性string-
inputClassNameinput className属性string-
style组件style属性React.CSSProperties-
inputStyleinput style属性React.CSSProperties-
size输入框尺寸,可选值为largesmalldefaultstring-
append带标签的 input,设置后置标签string|ReactNode
appendProps设置后置标签属性object
prepend带标签的 input,设置前置标签string|ReactNode
prependProps设置前置标签属性object
defaultValue输入框默认内容string
value输入框内容string
disabled是否禁用状态,默认为 falsebooleanfalse
id输入框的 idstring
prefix带有前缀图标的 inputstring|ReactNode
prefixProps前缀图标属性object
suffix带有后缀图标的 inputstring|ReactNode
suffixProps后缀图标属性object
type声明 input 类型,同原生 input 标签的 type 属性,见:MDNstringtext
onChange输入框内容变化时的回调function(value,e)
onPressEnter按下回车的回调function(e)
allowClear可以点击清除图标删除内容boolean

Input 的其他属性和 React 自带的 input 一致。

Input.Search

参数说明类型默认值
enterButton是否有确认按钮,可设为按钮文字。该属性会与 append 冲突。boolean|ReactNodefalse
onSearch点击搜索或按下回车键时的回调function(value, event)

其余属性和 Input 一致。

Input.TextArea

参数说明类型默认值
autosize自适应内容高度,可设置为 true|false 或对象:{ minRows: 2, maxRows: 6 }boolean|objectfalse

其余属性和 Input 一致。