forked from fanruan/fineui
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.
54 lines
1.3 KiB
54 lines
1.3 KiB
7 years ago
|
# bi.code_editor
|
||
|
|
||
7 years ago
|
## 代码文本框,基类[BI.Single](/core/single.md)
|
||
7 years ago
|
|
||
|
{% method %}
|
||
7 years ago
|
[source](https://jsfiddle.net/fineui/fx86hLgm/)
|
||
7 years ago
|
|
||
|
{% common %}
|
||
|
```javascript
|
||
|
|
||
|
BI.createWidget({
|
||
|
type: "bi.code_editor",
|
||
|
cls: "mvc-border",
|
||
|
width: 600,
|
||
|
height: 400
|
||
|
});
|
||
|
|
||
|
|
||
|
```
|
||
|
|
||
|
{% endmethod %}
|
||
|
|
||
|
## API
|
||
|
##### 基础属性
|
||
|
| 参数 | 说明 | 类型 | 可选值 | 默认值
|
||
|
| :------ |:------------- | :-----| :----|:----
|
||
7 years ago
|
| watermark | 文本框placeholder | string | — | " " |
|
||
7 years ago
|
| readOnly | 是否只读 | boolean | true,false | false|
|
||
|
| lineHeight | 行高 | number|— | 2|
|
||
7 years ago
|
| value | 文本框值| string| —| " "|
|
||
|
| paramFormatter| 参数显示值构造函数 | function| — | value |
|
||
7 years ago
|
|
||
|
|
||
|
|
||
|
## 对外方法
|
||
|
| 名称 | 说明 | 回调参数
|
||
|
| :------ |:------------- | :-----
|
||
|
| insertParam | 插入参数 | param |
|
||
|
| insertString | 插入字符串 | str|
|
||
|
| getValue | 获取文本框值|—|
|
||
|
| setValue | 设置文本框值|value|
|
||
|
| focus | 文本框获取焦点| — |
|
||
|
| blur | 文本框失焦|—|
|
||
|
| setStyle | 设置文本样式 |需要设置的文本标签样式style,例{"color":"#000"} |
|
||
|
| getStyle | 获取文本样式 |— |
|
||
|
| refresh | 刷新文本框 | —|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
---
|
||
|
|
||
7 years ago
|
|