grafana - 为 AddTextInput 启用多行
问题描述
我正在为 Grafana 编写自己的插件,我想显示多行(即行),addTextInput
以便我可以在文本框中编写文本段落(即像 grafana 自己的文本插件的内容输入)。默认情况下,addTextInput 只有一行。这应该很简单,但不知何故我在文档中找不到该功能。有谁知道该怎么做?
在module.ts 中:
return builder
.addTextInput({
path: 'myText',
name: 'This is supposed to be a multiple line input',
defaultValue: '',
})
});
解决方案
经过数小时的谷歌搜索和查看其他人的源代码后,我终于找到了答案。这是在文本输入上启用多行的方法:
return builder
.addTextInput({
path: 'myText',
name: 'This is supposed to be a multiple line input',
defaultValue: '',
settings: {
useTextarea:true,
rows: 5,
}
})
});
我不确定为什么文档中没有记录。
推荐阅读
- php - 类别和子类别不匹配
- sql - 无法删除约束 - 不存在的约束
- swift - Swift Combine 替代 Rx Observable.create
- r - 计算交点后的几何不一致
- android - 什么构成 AsyncTask 的“UI 交互”?
- sql-server - SQL Server - 高缓冲时间
- java - 尝试打印和加法以及之前读取的变量,但 pinting 仅显示基本的加法变量
- r - 当值显示有不同的行作为最小值时,为什么 whi.min 函数会指定不同的行作为其输出?
- tensorflow - TensorFlow 示例未找到 contrib.tensorboard.plugins
- redis - Redis KeyMiss 通知未触发