bricks/dist/docs/zh/keypress.md
yumoqing 1291f7fee3 fix: UiCode build_options uses valueField/textField fallback to 'value'/'text'
When valueField/textField are not explicitly set in opts, the auto-select
logic (line 1140) and nullable empty-option creation (lines 1144-1145) used
data[0][undefined] which returned undefined, causing:
- Single-option selects to show blank (auto-select failed)
- nullable empty options to have undefined keys

Now extracts vf/tf local variables with ||'value'/||'text' fallback at the
top of build_options(), used consistently throughout.
2026-05-29 23:03:52 +08:00

14 lines
508 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# KeyPress
控件功能:监听键盘按键事件,当用户按下任意键时,清除当前内容并显示按下的键名。
类型:容器控件
父类控件VBox
## 初始化参数
- 无特殊初始化参数,继承自 `bricks.VBox` 的通用参数(如布局相关选项等)。
## 主要事件
- `keydown`:绑定全局键盘按下事件,触发 `key_handler` 方法处理按键逻辑。
在该事件中获取 `event.key` 值,并动态创建显示按键信息的文本控件。