bricks/dist/docs/cn.old/jswidget.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

26 lines
915 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.

# JsWidget
Bricks框架的最原始的控件所有Bricks的控件均继承自JsWidget或其后代。
## 构建选项
## 属性
### dom_element
dom_element是控件对应的dom元素。
## 方法
### create()
创建dom元素的方法并将新创建的元素保存在dom_element属性中JsWidget创建一个”div“的元素 子类通过提供自己的create函数创建自己特定的dom元素。
### set_css(css_name, delflg)
增加或删除一个css类 当delflg为真时删除一个“css_name”css类否则增加一个“css_name”类
### sizable
sizable函数让当前类有按照bricks_app.charsize的大小设置自身大小的能力并在charsize变化时改变自身的大小
### change_fontsizets
change_fontsize函数由bricks_app.textsize_bigger()textsize_smaller函数调用用来改变控件的大小
## 事件