<el-form-item v-for="(item, index) in formData.picSize" :key="item.title" :label="item.title" class="yydh-bili">
<el-form-item
:prop="'item.' + index + '.width'"
:rules="picRules"
>
<el-input v-model="item.width" style="width: 80px; margin-right: 10px;"></el-input>
<span>:</span>
</el-form-item>
<el-form-item
:prop="'item.' + index + '.height'"
:rules="picRules"
>
<el-input v-model="item.height" style="width: 80px; margin-right: 10px;"></el-input>
</el-form-item>
</el-form-item>
<script>
formData: {
picSize: [
{
name:'ACTIVITYBIGSIZE',
title: 'title1',
width: 4,
height: 3,
},
{
title: 'title2',
width: 4,
height: 3,
},
],
}
</script>
The solution is to change the definition of the form’s data proformitemsize
<el-form-item v-for="(item, index) in formData.picSize" :key="item.title" :label="item.title" class="yydh-bili">
<el-form-item
<!--Im here-->
:prop="'picSize.' + index + '.width'"
:rules="picRules"
>
<el-input v-model="item.width" style="width: 80px; margin-right: 10px;"></el-input>
<span>:</span>
</el-form-item>
<el-form-item
<!--Im here-->
:prop="'picSize.' + index + '.height'"
:rules="picRules"
>
<el-input v-model="item.height" style="width: 80px; margin-right: 10px;"></el-input>
</el-form-item>
</el-form-item>
Read More:
- [Vue warn]: Error in mounted hook: “Error: please transfer a valid prop path to form item“
- [Vue warn]Error in mounted hook: “Error: please transfer a valid prop path to form item“
- [Solved] Error in v-on handler: “Error: please transfer a valid prop path to form item
- [Solved] Error in mounted hook: “Error: please transfer a valid prop
- [Vue warn]: Invalid prop: custom validator check failed for prop “index“
- The page console error [Vue warn]: Invalid prop: custom validator check failed for prop “status“
- Vue3.0 error: Failed to resolve component el-form-item (el element to be unable to be displayed)
- [Vue warn]: Invalid prop: type check failed for prop “index“. Expected String, got Undefined
- [Solved] Invalid prop: type check failed for prop “modelValue“. Expected Number…
- [Vue warn]: Invalid prop: custom validator check failed for prop “navigationBarTextStyle“.
- [Solved] Invalid prop: type check failed for prop “index“. Expected String, got Undefined
- [Vue warn]: Invalid prop: type check failed for prop [How to Solve]
- How to Solve Error: [Vue warn]: Missing required prop: “value”
- [Solved] Element form method resetfields() error: vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read properties of undefined (reading ‘indexOf’)
- How to Solve VUE Error: Avoid mutating a prop directly since the value will be overwritten …
- Vue form validate error: Error in v-on handler “TypeError Cannot read properties of undefined (reading ‘indexOf‘)
- How to Solve Props value transfer International Language error
- [Solved] Vue item packaging error: Failed to load resource: the server responded with a status of 404 (Not Found)
- [Solved] el-date-picker Error: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders.
- Vue modifies the value passed by props error: Avoid mutating a prop directly since the value will be overwritten whenever the par