# @beisen-cmps/italent-input-pc

> ## 示例

Latest version **1.0.12** (published 2019-03-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @beisen-cmps/italent-input-pc
pnpm add @beisen-cmps/italent-input-pc
yarn add @beisen-cmps/italent-input-pc
bun add @beisen-cmps/italent-input-pc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.12 |
| Published | 2019-03-13 |
| First published | 2019-02-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 404.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | beisencorp |

## Links

- npm: https://www.npmjs.com/package/@beisen-cmps/italent-input-pc
- Repository: git@gitlab.beisencorp.com:ux-upaas-app/italent-input
- npm.io page: https://npm.io/package/@beisen-cmps/italent-input-pc

## Dependencies (1)

- [styled-components](https://npm.io/package/styled-components.md) ^4.0.1

## Recent versions

- 1.0.12 (latest) — 2019-03-13
- 1.0.11 — 2019-03-03
- 1.0.10 — 2019-02-20
- 1.0.8 — 2019-02-20
- 1.0.7 — 2019-02-18
- 1.0.6 — 2019-02-18
- 1.0.5 — 2019-02-18
- 1.0.4 — 2019-02-18
- 1.0.3 — 2019-02-18
- 1.0.2 — 2019-02-18
- 1.0.1 — 2019-02-18
- 1.0.0 — 2019-02-18

## README

# italent-pc input 组件

## 示例

模块

```shell
  npm install @beisen-cmps/italent-input-pc --save
```

```js
import React, { Component } from "react"
import Input from "./../../src"

export default class extends Component {
	constructor(props) {
		super(props)
		this.state = {
			name: "",
			errMsg: ""
		}
	}
	handleChange = value => {
		if (value == "") {
			this.setState({
				name: value,
				errMsg: "不能为空"
			})
			return
		}
		this.setState({
			name: value,
			errMsg: ""
		})
	}
	handleBlur = value => {
		if (value == "") {
			this.setState({
				name: value,
				errMsg: "不能为空"
			})
			return
		}
		this.setState({
			name: value,
			errMsg: ""
		})
	}
	render() {
		const { name, errMsg } = this.state
		const testProps = {
			// defaultValue: "adsad",
			isRequire: true,
			allowClear: true,
			value: name,
			onChange: this.handleChange,
			onBlur: this.handleBlur,
			errMsg: errMsg,
			inline: true,
			label: "测试文案",
			info: "测试提示",
			style: {
				marginTop: "10px"
			}
		}
		return <Input {...testProps} />
	}
}
```

## 参数

**isRequire** 是否必填 默认 false（决定是否显示前面的\*）

**type** input 原生属性

**value** 输入框的值

**allowClear** 是否显示清空按钮 默认 true

**isControl** 是否是受控组件 默认 true

**defaultValue** 默认值

**id** 输入框 id

**errMsg** 错误提示 只要有就会显示

**info** 下方提示

**label** input 前面显示的文字

**labelWidth** 文本框前面文字占的宽度

**placeholder** 文本框内的提示 labelWidth

**style** 最外包裹层的样式

**inline** 是否在一行显示 默认 true

**onBlur** 失焦回调 function(value){}

**onChange** change 回调 function(value){}

---
_Source: https://npm.io/package/@beisen-cmps/italent-input-pc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
