ui.Lable
# ui.Lable
返回文本。
函数 | 返回值 |
---|---|
ui.Label(value, style, url) | Object |
参数 | 类型 | 说明 |
---|---|---|
value | String | 文本标签内容 |
style | Object | 文本组件的样式 |
url | String | 指定跳转的的URL路径 |
# setValue
设置文本内容。
函数 | 返回值 |
---|---|
setValue(value) | ui.Label |
参数 | 类型 | 说明 |
---|---|---|
value | String|Number|Date | 文本内容 |
# getValue
返回文本内容。
函数 | 返回值 |
---|---|
getValue() | String |
# setURL
设置指定的URL,默认为空。
函数 | 返回值 |
---|---|
setURL(url) | ui.Label |
参数 | 类型 | 说明 |
---|---|---|
url | String | 指定url的地址 |
# getURL
返回指定的URL。
函数 | 返回值 |
---|---|
getURL() | String |
# setStyle
设置文本组件样式。
函数 | 返回值 |
---|---|
setStyle(style) | ui.Label |
参数 | 类型 | 说明 |
---|---|---|
style | Object | 文本组件样式 |
# getStyle
返回文本组件样式。
函数 | 返回值 |
---|---|
getStyle() | Object |
/**
* @File : ui.Label
* @Time : 2021/3/23
* @Author : piesat
* @Version : 1.0
* @Contact : 400-890-0662
* @License : (C)Copyright 航天宏图信息技术股份有限公司
* @Desc : 文本组件示例
*/
var style = {
"font-size": "12px",
};
var label = ui.Label("文本", style, "https://engine.piesat.cn");
label = label.setValue("PIE-Engine遥感云计算平台");
print(label);
var label = ui.Label("测试文本");
var panel = ui.Panel({
widgets: [label],
style: {
width: "100px",
},
});
ui.root.add(panel);
有问题,我来改改 (opens new window)
上次更新: 2022/05/25, 03:27:07