Socket
Socket
Sign inDemoInstall

@beisen-phoenix/input

Package Overview
Dependencies
Maintainers
1
Versions
410
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beisen-phoenix/input

> @beisen-phoenix/input


Version published
Weekly downloads
422
Maintainers
1
Weekly downloads
 
Created
Source

基础输入框

@beisen-phoenix/input

概述

通过鼠标或键盘输入内容,是最基础的表单域的包装。

API

参数说明类型默认值是否必传
type输入框类型,仅支持 text password hiddenstringtext
size输入框尺寸,支持 default large smallstringdefault
value输入框内容string-
defaultValue输入框默认内容,若使用了 value,则 defaultValue 无效boolean-
placeholder同原生 inputstring请输入
status输入框状态,正常、禁用、提示、错误,支持 normal disabled isHint errorstringnormal
readOnly只读状态,不能输入,不显示清除按钮booleanfalse
autoFocus首次挂载时是否自动获取焦点booleanfalse
maxLength最大输入字符数,同原生 inputnumber-
prefix前缀元素React.ReactNode-
suffix后缀元素,同 prefixReact.ReactNode-
translation国际化,详情见下方object-
onChange输入框内容变化时的回调function(value: string)-
onFocus获取焦点时的回调function(value: string)-
onBlur失去焦点时的回调function(value: string)-
onEnter按下回车的回调function(value: string)-
onClear按下清除图标的回调function()-
onClick点击输入框时的回调function(event)-
extraCls自定义组件容器 class,一般用于覆盖组件默认样式使用string-
clearFocus输入框激活时 点击清除按钮 输入框是否激活booleanfalse
allowPoprationOnClear点击清除按钮时,click 事件是否冒泡booleanfalse
lang当前语言环境(zh_CN,en_US,zh_TW)stringzh_CN

translation

translation: {
  placeholder: '请输入'
}

2019-11-19

新增 lang 属性,用于表示当前的语言环境,取值范围为“zh_CN,zh_TW,en_US”内部新增中文简体、英文、中文繁体语言包。

2019-09-12

更新设计: 可操作输入框文字超长时打点【保证 chrome 能正常打点即可】,不显示 tooltip 仅在禁用,只读时显示 tooltip

2019-09-18

新增 api | clearFocus | 输入框激活时 点击清除按钮 输入框是否激活 | boolean | false | 否 |

FAQs

Package last updated on 25 Nov 2019

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