使用vue的v-if判断数组长度length报错解决方案
直接使用 length 报错:
Error in render: "TypeError: Cannot read property 'length' of undefined"
<div v-if="info.lists.length>0"> </div>
解决办法:
<div v-if="info.lists && info.lists.length>0"> </div>
直接使用 length 报错:
Error in render: "TypeError: Cannot read property 'length' of undefined"
<div v-if="info.lists.length>0"> </div>
解决办法:
<div v-if="info.lists && info.lists.length>0"> </div>