I need help using a JS array in a Vue.js function for looping.
Here is the code I tried:
Vue:
computed: {
bbb: function(){
var vvv=this.Preused.length-this.quote.lines.length;
let added_products=[];
if(vvv > 0){
for(var i = 0; i <= vvv-1; i++){
newly_used.push({...this.Preused[this.manage.code.length+i]});
}
}
return newly_used;
}
}
HTML:
<div v-for="(cc,index) in bbb">
<p v-text="cc[index].num"></p>
</div>
newly_used:
0:
none: "calibry"
des: "Silver"
num: "numty"
After implementing the above code, I encountered the following error message;
[Vue warn]: Error in render: "TypeError: Cannot read property 'num' of undefined"
Any suggestions on how to resolve this issue?