Is it known that if you display an Object's property in a Vue.js template, and the object is undefined - that will crash the component. Regular variables are no problem if they're undefined.
This behavior is a killjoy. In my situation, which seems pretty generic, what is the best way to avoid this problem?
So I store data in a NoSQL database i.e. Mongo, and have a Vue.js component to view and modify the documents in the collection. Which works well.
But if I add an Object with properties to my schema (for example address with zip, state...), and update the component to display them, now all the components in my webapp will crash that display these documents because the object isn't in the data. Only new documents (with the new object) will show correctly, unless I go thru the database and add this "address" object to every existing document.
It would be great if the template could give the user an opportunity to view blank or add data that isn't already in the database.
What is a best practice in such a situation?
Should objects simply be avoided here?