Reputation: 1
I would like to know how I can get the length of my array in Native script /vue JS?
My code :
export default {
data: () => {
return {
i: 0,
log: [],
img:[
"~/Pictures/home.png",
"~/Pictures/test.png"
],
};
},
Do you have an idea?
Upvotes: 0
Views: 210
Reputation: 325
You could use a computed property for this.
Assuming you want the length of the img
array:
export default {
data() {
return {
img: ["~/Pictures/home.png", "~/Pictures/test.png"]
};
},
computed: {
imgArrayLength() {
return this.img.length;
}
}
};
</script>
Upvotes: 1