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