Cannot read property 'XXX' of undefined"


实例:

报错:Cannot read property 'itemGroupList' of undefined"

解决方法:在itemGroupList上一层判断一下父级元素

<div v-if="table2.itemCat">
   <div v-for="(itemgrounp,indexgrounp) in table2.itemCat.itemGroupList" :key="indexgrounp">
       <div>
           <div style="display:flex;juistify-content:flex-start;margin:10px">
           <span>分组名:</span>
           <el-input v-model="itemgrounp.group_name" placeholder="请输入分组名称" class="grounp_name"></el-input>
           <el-button @click="deleteBygroundid(indexgrounp)" type="danger" icon="el-icon-delete" style="height:40px;margin-left:15px" circle></el-button>
       </div>
   </div>
</div>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM