<Form class="NewVersion" ref="formRef" name="NewVersion" :model="formData">
<Space
v-for="(newPg, index) in formData.version"
:key="index"
style="display: flex; margin-bottom: 8px"
align="baseline"
>
<FormItem
:name="['version', index, 'name']"
:rules="{
required: true,
message: 'Missing last name',
}"
>
<Input v-model:value="newPg.name" placeholder="Last Name" />
</FormItem>
<FormItem
:name="['version', index, 'role']"
:rules="{
required: true,
message: 'Missing last name',
}"
>
<Input v-model:value="newPg.role" placeholder="Last Name" />
</FormItem>
<div @click="removeUser(newPg)">删除</div>
</Space>
</Form>
不然则会出现 Input.js:207 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'value')