@bpmn-io/feel-编辑器
可嵌入编辑器 感觉表达式。 。 。 .
使用量
要开始, 创建一个感觉编辑实例 :
import FeelEditor from '@bpmn-io/feel-editor';
const editor = new FeelEditor({
container
});
配置感官方言( 表达式或无函数测试) :
const editor = new FeelEditor({
container,
dialect: 'unaryTests' // defaults to 'expression'
});
您可以提供起始文档并查看更改:
const editor = new FeelEditor({
container,
onChange,
onKeyDown,
onLint,
value
});
变量
您可以提供用于自动补全的变量数组 。 嵌入 结构得到支持. 变量需要采用以下格式:
const editor = new FeelEditor({
container,
variables: [
{
name: 'variablename to match',
detail: 'optional inline info',
info: 'optional pop-out info',
entries: [
{
name: 'nested variable',
...
}
]
}
]
});
变量可通过 FeelEditor#setVariables()数字 :
editor.setVariables([
{
name: 'newName',
detail: 'new variable inline info',
info: 'new pop-out info'
}
]);
内容属性
您可以提供将设置在内容可编辑 div 上的属性 :
const editor = new FeelEditor({
container,
contentAttributes: {
'aria-label': 'Expression editor'
}
});
活动
你可以听编辑发来的消息:
const editor = new FeelEditor({
container
});
editor.on('lint', ({ diagnostics }) => console.log(diagnostics));
黑客项目
要得到开发设置 确保有 节点JS 已安装. 设置后立即复制项目并执行
npm install
npm start
许可证
麻省理工学院