File tree Expand file tree Collapse file tree 4 files changed +16
-14
lines changed
demo/src/index/views/Demo/schemaTypes/3.Arrays
fields/ArrayField/arrayTypes Expand file tree Collapse file tree 4 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ export default {
147147 } ,
148148 } ,
149149 multipleChoicesList : {
150- 'ui:widget' : 'checkboxes ' ,
150+ 'ui:widget' : 'CheckboxesWidget ' ,
151151 } ,
152152 fixedItemsList : {
153153 items : [
Original file line number Diff line number Diff line change 171171 },
172172 },
173173 multipleChoicesList: {
174- ' ui:widget' : ' checkboxes ' ,
174+ ' ui:widget' : ' CheckboxesWidget ' ,
175175 },
176176 fixedItemsList: {
177177 items: [
Original file line number Diff line number Diff line change @@ -9,10 +9,9 @@ import {
99} from '../../../common/formUtils' ;
1010import retrieveSchema from '../../../common/schema/retriev' ;
1111
12- import CheckboxesWidget from '../../../widgets/CheckboxesWidget ' ;
12+ import WIDGET_MAP from '../../../config/WIDGET_MAP ' ;
1313import Widget from '../../../fieldComponents/Widget' ;
1414
15-
1615export default {
1716 name : 'ArrayFieldMultiSelect' ,
1817 props : {
@@ -23,18 +22,21 @@ export default {
2322 }
2423 } ,
2524 render ( h ) {
25+ // 这里需要索引当前节点,通过到schemaField组件的会统一处理
26+ const itemsSchema = retrieveSchema ( this . schema . items , this . rootSchema , this . itemsFormData ) ;
27+ const enumOptions = optionsList ( itemsSchema , this . uiSchema ) ;
28+
2629 const widgetConfig = getWidgetConfig ( {
2730 schema : this . schema ,
2831 uiSchema : this . uiSchema
29- } , ( ) => {
30- // 这里需要索引当前节点,通过到schemaField组件的会统一处理
31- const itemsSchema = retrieveSchema ( this . schema . items , this . rootSchema , this . itemsFormData ) ;
32- const enumOptions = optionsList ( itemsSchema , this . uiSchema ) ;
33- return {
34- widget : CheckboxesWidget ,
35- enumOptions
36- } ;
37- } ) ;
32+ } , ( ) => ( {
33+ widget : WIDGET_MAP . common . checkboxGroup
34+ } ) ) ;
35+
36+ // 存在枚举数据列表 传入 enumOptions
37+ if ( enumOptions ) {
38+ widgetConfig . uiProps . enumOptions = enumOptions ;
39+ }
3840
3941 return h (
4042 Widget ,
Original file line number Diff line number Diff line change 44### 组件说明
55单文件夹为单个组件,组件需要统一为v-model双向绑定值
66
7- #### Checkboxes
7+ #### CheckboxesWidget
88说明:多选列表,接受value 和 enumOptions参数
99> value - array,选中的值
1010> enumOptions - Array ,下拉选项
You can’t perform that action at this time.
0 commit comments