I am currently seeking a solution to set a property from getters to the firestore section using vue. I have implemented vuefire, but encountered the following error:
vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read property 'getToUid' of undefined
Here is my code snippet:
data: () => ({
name:'',
}),
firestore: () => ({
// eslint-disable-next-line no-undef
usersList: db.collection(users),
dmMessages: db.collection(direct_message).doc(this.getToUid).collection(message_collection_name)
}),
computed: {
...mapGetters({
getToUid: "chats/GET_TO_UID",
}),
}
What would be the most optimal approach to include the getToUid
in this line :
dmMessages: db.collection(direct_message).doc(this.getToUid).collection(message_collection_name)