我正在为 Formio 隐藏表单的按钮组件而苦苦挣扎。我需要在我的表单中隐藏我的提交按钮。请帮忙。提前致谢
我认为唯一应该起作用的东西可以在我的代码中看到。我也尝试将它renderOptions
作为一个数组放入我的数组中。还没有任何效果。
HTML:
<div>
<formio
[form]="structuredForm"
[submission]='{"data":formSubmission }'
[renderOptions]="formioRenderOptions"
hide-components="['submit', 'submit5']">
</formio>
</div>
我formioRenderOption
需要在这里设置隐藏按钮吗?
this.formioRenderOptions = {
noAlerts: true,
language: this.translateService.currentLang.replace('_', '-')
i18n: '',
readOnly: true,
};
我的 Formio JSON 文件有 2 个按钮:
{
"label": "save",
"action": "event",
"showValidations": false,
"event": "saveDraftEvent",
"theme": "primary",
"shortcut": "",
"disableOnInvalid": true,
"mask": false,
"tableView": true,
"alwaysEnabled": false,
"type": "button",
"key": "submit4",
"input": true,
"conditional": {
"show": "",
"when": "",
"json": ""
},
"customConditional": "",
"properties": {},
"tags": [],
"logic": [],
"defaultValue": true
},
{
"label": "next",
"action": "event",
"showValidations": false,
"event": "submitApplicationEvent",
"theme": "primary",
"shortcut": "",
"disableOnInvalid": true,
"mask": false,
"tableView": true,
"alwaysEnabled": false,
"type": "button",
"key": "submit5",
"input": true,
"conditional": {
"show": "",
"when": "",
"json": ""
},
现在我的表单是只读的,但是按钮仍然可见而不是隐藏。