说明
NativeType 可取 text / password / email / number / search 等。
常见能力:
- 前缀图标
- 后缀内容
- 字数限制
- 失焦触发 Live
- 回车回调
用法
<Input @bind-Value="@name" Icon="user" Placeholder="请输入用户名" />
<Input NativeType="password" Icon="lock" />
API 参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
Icon |
string |
null |
左侧图标。 |
Id |
string |
null |
|
Invalid |
bool |
false |
错误状态(红框)。 |
Live |
bool |
false |
输入后立即触发(默认失焦触发)。 |
MaxLength |
int |
0 |
最大长度。 |
NativeType |
string |
"text" |
原生 input 类型:text / password / email / url / search / tel。 |
OnEnter |
EventCallback |
— | 事件 回车回调。 |
Placeholder |
string |
null |
占位文字。 |
ReadOnly |
bool |
false |
只读。 |
Size |
string |
null |
尺寸:lg / sm。 |
SuffixContent |
RenderFragment |
null |
后缀内容。 |
Value |
string |
null |
绑定值。 |
ValueChanged |
EventCallback<string> |
— | 事件 |
Visible |
bool |
true |
取得或设置组件是否可见,默认为false。 |
VisibleChanged |
EventCallback<bool> |
— | 事件 取得或设置组件可见性变化时的回调事件。 |
Class |
string |
null |
取得或设置组件的CSS类名,用于自定义样式。 |
Disabled |
bool |
false |
取得或设置组件是否禁用,默认为false。 |
Style |
string |
null |
取得或设置组件的内联样式,用于自定义样式。 |
所有组件均继承
BaseComponent,除上表参数外还支持Class、Style、Disabled、Visible。
扫码关注公众号
扫码加入 QQ 群