mirror of
https://github.com/vxcontrol/ncform.git
synced 2026-07-21 06:15:23 -04:00
feat: key with form-name for form-item
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<component v-if="isNormalObjSchema(schema)" :is="'ncform-' + schema.ui.widget" :schema="schema" v-bind="commonAttrs">
|
||||
|
||||
<template v-for="(fieldSchema, fieldName) in schema.properties" :slot="fieldName">
|
||||
<form-item :schema="fieldSchema" :form-data="formData" :temp-data="tempData" :global-const="globalConfig.constants" :key="fieldName" :global-config="globalConfig" :idx-chain="idxChain" :complete-schema="completeSchema" :paths="paths ? paths + '.' + fieldName : fieldName" :form-name="formName"></form-item>
|
||||
<form-item :schema="fieldSchema" :form-data="formData" :temp-data="tempData" :global-const="globalConfig.constants" :key="`${formName}-${fieldName}`" :global-config="globalConfig" :idx-chain="idxChain" :complete-schema="completeSchema" :paths="paths ? paths + '.' + fieldName : fieldName" :form-name="formName"></form-item>
|
||||
</template>
|
||||
|
||||
</component>
|
||||
@@ -15,7 +15,7 @@
|
||||
<component v-else-if="isNormalArrSchema(schema)" :is="'ncform-' + schema.ui.widget" :schema="schema" v-bind="commonAttrs" class="__ncform-control">
|
||||
|
||||
<template v-for="(fieldSchema, fieldName) in (schema.items.properties || {__notObjItem: schema.items})" :slot="fieldName" slot-scope="props">
|
||||
<form-item :schema="props.schema" :key="fieldName" :form-data="formData" :temp-data="tempData" :global-const="globalConfig.constants" :idx-chain="(idxChain ? idxChain + ',' : '') + props.idx" :global-config="globalConfig" :complete-schema="completeSchema" :paths="paths + '[' + props.idx + ']'" :form-name="formName"></form-item>
|
||||
<form-item :schema="props.schema" :key="`${formName}-${fieldName}`" :form-data="formData" :temp-data="tempData" :global-const="globalConfig.constants" :idx-chain="(idxChain ? idxChain + ',' : '') + props.idx" :global-config="globalConfig" :complete-schema="completeSchema" :paths="paths + '[' + props.idx + ']'" :form-name="formName"></form-item>
|
||||
</template>
|
||||
|
||||
</component>
|
||||
|
||||
Reference in New Issue
Block a user