I have the following data object in my Vue component:
data() { return { items: {} } }, I make a check to see if it is empty and display a message:
<tr v-if="items.data.length === 0"><p>There are currently no items.</p></tr> This code works, however I get the following error messages in the console:
Error in render: "TypeError: Cannot read property 'length' of undefined"
TypeError: Cannot read property 'length' of undefined
How can I check if an object is undefined? Sometimes the items object is filled with data and sometimes it isn't.