输入框 FormControl
issue

<FormControl> 来代替 <input>, <textarea>

何时使用

代替原生 input

如何使用

import { FormControl } from 'tinper-bee';

or

import FormControl from 'bee-form-control';
import 'bee-form-control/build/FormControl.css';

能力特性

API

FormControl

参数 说明 类型 默认值
className 类名 string -
componentClass 说明表单类型(input,textarea) string 'input'
type 类型(text,search, submit,'checkbox',...详情http://www.w3school.com.cn/html5/att_input_type.asp) string 'text'
onChange input值发生改变触发的回调 func -
debounceDelay 函数防抖时间间隔 number -
onKeyDown keydown回调 func -
value input当前值 string -
defaultValue input默认值 string -
onSearch input type="search" 回车和点击搜索按钮的回调 func -
showClose 是否显示清空按钮 bool -
focusSelect 设置当focus的时候是否选择内容 bool false
prefix 设置前缀。默认宽度 30px,可通过复写样式更改 node/string -
suffix 设置后缀。默认宽度 30px,可通过复写样式更改 node/string -
maxLength 设置最大长度;注:如果非首次渲染更新input的value的时候,不会自动截断value,需在设置value之前将value值手动截断 number -

TextArea

配置 componentClass="textarea" 使用文本域组件

参数 说明 类型 默认值
autoSize 自适应内容高度,可设置为 true false 或对象:{ minRows: 2, maxRows: 6 } boolean
onPressEnter 按下回车的回调 function(e) -
onResize resize 回调 function({ width, height }) -

注意事项

暂无

更新日志

  • v2.0.24 2020-08-13 ( release地址 )

    Features

  • v2.0.23 2020-07-20 ( release地址 )

    Bug Fixes

    Features

    • maxLength (e832e80)
    • textarea支持自适应文本高度[JCJS-2437] (4a40fb1)
  • v2.0.22 2020-07-02 ( release地址 )

    Bug Fixes

    • 最大长度无法输入中文bug (3639189)
  • v2.0.21 2020-06-02 ( release地址 )

    Bug Fixes

  • v2.0.20 2020-05-29 ( release地址 )

    Features

  • v2.0.19 2020-04-24 ( release地址 )

    Bug Fixes

    • blur回调增加参数,判断是否为清空操作 (62ed3f3)
    • 自动化 (ae44701)

  • v2.0.9 2019-09-24 ( release地址 )

    • bee-form-control @2.0.9
      • [Update]解决 value 设置为 undefined 或 null 时,报警告的问题。
  • v2.0.8 2019-09-21 ( release地址 )

    • bee-form-control @2.0.8
      • [Update]解决 Warning: React does not recognize the debounceDelay prop on a DOM element.
  • v2.0.7 2019-08-20 ( release地址 )

    • bee-form-control @2.0.7
      • [ Fixbug ]解决了清空value后删除按钮仍然可见的问题。
      • [ Update ] 有value时光标移出后,删除按钮自动隐藏。
  • v2.0.6 2019-08-05 ( release地址 )

    • bee-form-control @2.0.6
      • [Fixbug]不能输入的问题
  • v2.0.5 2019-08-03 ( release地址 )

    • bee-form-control @2.0.5
      • [ Feature ] bee-form-control组件新增了onChange事件函数防抖功能和防抖时间间隔的属性。
  • v2.0.3 2019-05-20 ( release地址 )

    • bee-form-control @2.0.3
      • [Feature]带容器的输入框去掉多余的ClassName
  • v2.0.1 2019-03-08 ( release地址 )

    • [Fixbug]bee-form-control @2.0.1
      • 重新打包代码
  • v2.0.0 2019-03-07 ( release地址 )

    • [Feature]bee-form-control @2.0.0
      • 规范输入框不可用状态