# Input 输入框
# 安装
npm install @plutojs/input
# 引用
import Input from "@plutojs/input";
# 使用
const [text, setText] = useState("");
<Input
type="textarea"
value={text}
onChange={(e) => setText(e.target.value)}
/>;
# Props 配置
参数 | 说明 | 类型 | 可选值 | 默认值 | 必填 |
---|---|---|---|---|---|
type | 输入框类型 | String | - | text | 是 |
value | 输入内容 | String | - | - | 是 |
className | 样式名称 | String | - | - | 否 |
placeholder | 占位文字 | String | - | - | 否 |
onChange | 输入响应方法 | Function | - | - | 否 |
onFocus | 聚焦响应方法 | Function | - | - | 否 |
onBlur | 失焦响应方法 | Function | - | - | 否 |
maxLength | 最大输入长度 | Number | - | - | 否 |
offsetTop | 顶部预留空间 | Number | - | 100 | 否 |
disabled | 是否禁止使用 | Boolean | - | false | 否 |
# 实例方法
名称 | 说明 | 参数 |
---|---|---|
clear | 清空输入框内容 | - |