
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
对antd的Input/TextArea进行一层封装,限制用户输入长度,并实时显示用户输入的长度,可以单独使用,也可以结合表单一起使用,LimitInput属性与antd的Input完全保持一致,暂时没有自身独特的属性;LimitTextArea只有一个额外属性sep,表示分割符,可以是个字符串,如:',',也可以是个正则表达式,如:/\n\r/,默认为''
对antd的Input/TextArea进行一层封装,限制用户输入长度,并实时显示用户输入的长度,可以单独使用,也可以结合表单一起使用,LimitInput属性与antd的Input完全保持一致,暂时没有自身独特的属性;LimitTextArea只有一个额外属性sep,表示分割符,可以是个字符串,如:',',也可以是个正则表达式,如:/\n\r/,默认为''
npm i antd-input

import React, { PureComponent, Fragment } from 'react'
import { LimitInput } from 'antd-input'
class LimitInputExample extends PureComponent {
state = {
val: ''
}
onChange = (e) => {
e.preventDefault()
this.setState({ val: e.target.value })
}
render() {
const style = {
width: '100%',
margin: '8px 0px',
textAlign: 'left',
}
return (
<Fragment>
<div style={style}>单独使用:</div>
<LimitInput
value={this.state.val}
onChange={ e => this.onChange(e) }
/>
<div style={style}>
输入内容:{this.state.val}
</div>
</Fragment>
)
}
}
import React, { PureComponent, Fragment } from 'react'
import { LimitTextArea } from 'antd-input'
class LimitTextAreaExample extends PureComponent {
state = {
val: ''
}
onChange = (e) => {
e.preventDefault()
this.setState({ val: e.target.value })
}
render() {
const style = {
width: '100%',
margin: '8px 0px',
textAlign: 'left',
}
return (
<Fragment>
<div style={style}>单独使用:</div>
<div style={style}>
<LimitTextArea
value={this.state.val}
sep={'\n'}
onChange={ e => this.onChange(e) }
placeholder={'一行一条数据'}
/>
</div>
<div style={style}>
输入内容:{this.state.val}
</div>
</Fragment>
)
}
}
属性与antd的Input完全保持一致,暂时没有自身独特的属性
| 属性 | 描述 | 类型 | 默认值 | 是否必填 |
|---|---|---|---|---|
| maxLength | 设置用户最大输入字符数,原antd的Input属性 | number | 50 | 否 |
| 属性 | 描述 | 类型 | 默认值 | 是否必填 |
|---|---|---|---|---|
| maxLength | 设置用户最大输入字符数,原antd的InputArea属性 | number | 200 | 否 |
| sep | 分割符,可以是个字符串,如:',',也可以是个正则表达式,如:/\n\r/ | string | '' | 否 |
FAQs
对antd的Input/TextArea进行一层封装,限制用户输入长度,并实时显示用户输入的长度,可以单独使用,也可以结合表单一起使用,LimitInput属性与antd的Input完全保持一致,暂时没有自身独特的属性;LimitTextArea只有一个额外属性sep,表示分割符,可以是个字符串,如:',',也可以是个正则表达式,如:/\n\r/,默认为''
The npm package antd-input receives a total of 43 weekly downloads. As such, antd-input popularity was classified as not popular.
We found that antd-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.