Vue Formulate 提供表单模式——一种定义您想要的表单字段并让 Vue Formulate 负责呈现它的声明性方式。
目前对于我正在构建的复杂表单,我正在使用v-show
指令根据其他字段中的输入有条件地显示/隐藏表单字段,例如:
<div v-show="formValues.primaryIncomeType == 'selfEmployed'">
<formulate-input
name="companyNumber"
type="text"
label="UK company number"
></formulate-input>
...
这对表单模式来说是可能的吗?在没有运气的情况下尝试了以下一些变化:
{
component: "div",
style: "display: flex",
"v-show": "someCondition == true",
children: [
{
type: "currency",
name: "propertyValue",
label: "Property value",
validation: "required",
validationName: "Property value"
}
]
}