You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.9 KiB
78 lines
2.9 KiB
7 years ago
|
# bi.widget
|
||
|
|
||
7 years ago
|
## 所有控件的超类
|
||
7 years ago
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
7 years ago
|
| root | 根组件 | boolean | true,false | false |
|
||
|
| tagName | html标签 | string| —| "div" |
|
||
|
| attributes | 属性| object | —| null |
|
||
|
| data | 数据 | object | — | null |
|
||
7 years ago
|
| disabled | 是否可用 | boolean |true,false | false |
|
||
7 years ago
|
| invisible | 是否可见 | boolean | true,false | false|
|
||
7 years ago
|
| invalid | 是否有效 | boolean | true,false |false |
|
||
7 years ago
|
| baseCls | 基础class类 | string | —| " "|
|
||
|
| extraCls | 扩展class类 | string| — | " "|
|
||
|
| cls | class类名 | string |— | " "|
|
||
7 years ago
|
|
||
|
## 生命周期函数
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| beforeCreate | 组件实例刚被创建 |— |
|
||
|
| created | 组件实例创建完成 | —|
|
||
|
| render | 渲染组件 | — |
|
||
|
| beforeMounted | 组件挂载之前| —|
|
||
|
| mounted | 组件挂载 |—|
|
||
|
| update | 组件更新 | —|
|
||
|
| beforeDestroyed | 组件销毁前调用| —|
|
||
|
| destroyed | 组件销毁后调用 | —|
|
||
|
|
||
|
|
||
|
## 对外方法
|
||
7 years ago
|
#####(注: fineui2.0引入生命周期后,widget的实现类不需要重写setEnable,setValid等方法,会自动调用子组件的对应方法
|
||
7 years ago
|
#####,一些需要在设置状态后做的额外工作可以通过重写_setXXX来实现)
|
||
|
|
||
7 years ago
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| isMounted | 判断组件是否挂载| — |
|
||
|
| setWidth | 设置组件宽度 | width |
|
||
|
| setHeight | 设置组件高度 | height |
|
||
|
| setEnable | 设置组件是否可用 | enable |
|
||
|
| setVisible | 设置组件是否可见 | visible |
|
||
|
| setValid | 设置组件是否有效 | valid|
|
||
7 years ago
|
| doBehavior | 自定义下拉列表中item项的行为,如高亮,标红等 | —|
|
||
7 years ago
|
| getWidth | 获取组件宽度 | —|
|
||
|
| getHeight| 获取组件高度| —|
|
||
|
| isValid | 判断是否有效 | —|
|
||
|
| addWidget | 添加组件 | name,widget|
|
||
|
| getWidgetByName | 根据组件名称获取组件| name |
|
||
|
| removeWidget | 移除组件 | nameOrWidget |
|
||
|
| hasWidget | 判断是否有该组件 | name |
|
||
7 years ago
|
| getName | 获取组件名称 | —|
|
||
7 years ago
|
| setTag | 设置tag | tag |
|
||
|
| getTag | 获取tag | —|
|
||
|
| attr | 设置组件属性 | key,value |
|
||
|
| getText | 获取text值 | —|
|
||
|
| setText | 设置text值 | text|
|
||
|
| getValue | 获取value值 | —|
|
||
|
|setValue| 设置value值| value|
|
||
|
| isEnabled | 是否可用 | —|
|
||
|
| isVisible | 是否可见 | —|
|
||
|
| disable | 设置组件不可用 | —|
|
||
|
| enable | 设置组件可用| —|
|
||
|
| valid | 设置组件有效| —|
|
||
|
|invalid | 设置组件无效 | —|
|
||
|
| invisible | 设置组件不可见 | —|
|
||
|
| visible | 设置组件可见 | —|
|
||
7 years ago
|
| isolate | 组件不在页面展示,组件事件和内容都在 | —|
|
||
7 years ago
|
| empty | 清空组件 | —|
|
||
|
| destroy | 销毁组件| —|
|
||
|
|
||
|
|
||
|
|
||
|
---
|
||
|
|
||
7 years ago
|
|