mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
feat: checkboxs允许配置全选/不选文案 (#7408)
* perf: checkboxs允许配置全选/不选文案 * perf: checkboxs允许配置全选/不选文案 --------- Co-authored-by: yanglu19 <yanglu19@baidu.com>
This commit is contained in:
parent
c625db7b44
commit
5638927871
@ -141,6 +141,7 @@ export class CheckboxesControlPlugin extends BasePlugin {
|
||||
if (!value) {
|
||||
// 可全选关闭时,默认全选也需联动关闭
|
||||
form.setValueByName('defaultCheckAll', false);
|
||||
form.setValueByName('checkAllText', undefined);
|
||||
}
|
||||
}
|
||||
}),
|
||||
@ -153,7 +154,12 @@ export class CheckboxesControlPlugin extends BasePlugin {
|
||||
label: '默认全选',
|
||||
name: 'defaultCheckAll',
|
||||
value: false
|
||||
})
|
||||
}),
|
||||
{
|
||||
type: 'input-text',
|
||||
label: '全选文本',
|
||||
name: 'checkAllText'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -30,6 +30,10 @@ export interface CheckboxesControlSchema extends FormOptionsSchema {
|
||||
*/
|
||||
defaultCheckAll?: boolean;
|
||||
|
||||
/**
|
||||
* 全选/不选文案
|
||||
*/
|
||||
checkAllText?: string;
|
||||
/**
|
||||
* 每行显示多少个
|
||||
*/
|
||||
@ -337,6 +341,7 @@ export default class CheckboxesControl extends React.Component<
|
||||
onToggle,
|
||||
onToggleAll,
|
||||
checkAll,
|
||||
checkAllText,
|
||||
classnames: cx,
|
||||
itemClassName,
|
||||
labelClassName,
|
||||
@ -369,7 +374,7 @@ export default class CheckboxesControl extends React.Component<
|
||||
inline={inline}
|
||||
labelClassName={labelClassName}
|
||||
>
|
||||
{__('Checkboxes.selectAll')}
|
||||
{checkAllText ?? __('Checkboxes.selectAll')}
|
||||
</Checkbox>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user