title: Control configuration
Control configuration
The control
configuration item can be used to control whether other components are displayed by the value of the component
Examples
Maker
maker.radio('Whether or not', 'is_postage', 0).options([
{value: 0, label: 'No mail', disabled: false},
{value: 1, label: 'FREE', disabled: false},
]).control([
{
value: 1,
rule: [
maker.number ('Full Amount', 'postage_money', 0)
]
}
])
JSON
{
type: "radio",
title: "Whether it is free",
field: "is_postage",
value: 0,
options: [
{value: 0, label: 'No mail', disabled: false},
{value: 1, label: 'FREE', disabled: false},
],
control: [
{
value: 1,
rule: [
{
type: 'number',
field: 'postage_money',
title: 'Full Amount',
value: 0
},
]
}
]
}
Property description
value: Display the components in
rule
when the value of the component is equal tovalue
{
value: 1,
rule: [...]
}
handle
Function
: Display the components inrule
when thehandle
method returnstrue
{
handle: function (val, $f) {
return val === 1;
},
rule: [...]
}
rule
Array
: This component controls the displayed components{
value: 1,
rule: [
maker.number ('Full Amount', 'postage_money', 0)
]
}