Skip to content

Commit 8998f91

Browse files
committed
Add multiple choice enum binding to Vue
1 parent fea2b3a commit 8998f91

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

packages/vue/vue/src/jsonFormsCompositions.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import {
3030
mapStateToOneOfEnumCellProps,
3131
StatePropsOfJsonFormsRenderer,
3232
createId,
33-
removeId
33+
removeId,
34+
mapStateToMultiEnumControlProps,
35+
mapDispatchToMultiEnumProps
3436
} from '@jsonforms/core';
3537
import {
3638
CompType,
@@ -289,6 +291,16 @@ export const useJsonFormsOneOfControl = (props: ControlProps) => {
289291
return useControl(props, mapStateToOneOfProps, mapDispatchToControlProps);
290292
};
291293

294+
/**
295+
* Provides bindings for 'Control' elements which resolve to multiple choice enums.
296+
*
297+
* Access bindings via the provided reactive `control` object.
298+
* Dispatch changes via the provided `handleChange` method.
299+
*/
300+
export const useJsonFormsMultiEnumControl = (props: ControlProps) => {
301+
return useControl(props, mapStateToMultiEnumControlProps, mapDispatchToMultiEnumProps);
302+
};
303+
292304
export interface LayoutProps extends RendererProps {
293305
uischema: Layout;
294306
}

0 commit comments

Comments
 (0)