#header-mark#
Input 输入框
通过鼠标或键盘输入字符
基础用法
continuous_update
表示输入过程中是否持续发送更新事件。
禁用状态
你可以使用 disabled
属性来定义是否被禁用。
使用 disabled
属性来控制是否为禁用状态。该属性接受一个 bool
类型的值。
密码框
将 type
属性指定为 password
即可得到一个密码框。
文本域
将 type
属性指定为 textarea
即可得到一个密码框。
自定义样式
您可以自定义输入框的背景颜色、文字颜色、文字大小。
使用 style
属性额外配置样式:
background-color
设置背景颜色,可使用#ffffff
、blue
等和css
兼容的形式。color
设置文字颜色,可使用#ffffff
、blue
等和css
兼容的形式。font-size
设置文字大小。description-width
:label的宽度。
API
属性
属性名 | 说明 | 类型 | 默认值 |
---|---|---|---|
v-model/value | 绑定值 | str | — |
label | 标签文字 | str | — |
type | 类型 | enum | — |
continuous_update | 输入过程中是否持续发送更新事件 | boolean | false |
disabled | 按钮是否为禁用状态 | boolean | false |
placeholder | 输入框占位符 | str | - |
style | 自定义css样式 | str | - |
TIP
style 支持的其它css属性
Sizes相关
- height
- width
- max_height
- max_width
- min_height
- min_width
Display相关
- visibility
- display
- overflow
Box model相关
- border
- margin
- padding
Positioning相关
- top
- left
- bottom
- right
Events
事件名 | 说明 | 类型 |
---|---|---|
change | 当绑定值变化时,当输入框失去焦点或用户按Enter时触发 | Callable |
方法
属性名 | 说明 | 类型 |
---|
src/examples/ipywui/component/input