Nov 29, 2024
0
Level 1
Set() object cannot read properties of undefined with Vue3
There's a single post with id 1.
<div v-if="isChatVisible(1)" >
<Chat />
</div>
export default {
data() {
return {
visibileChats: new Set(),
};
},
methods: {
isChatVisible(postId) {
return this.visibleChats.has(postId);
},
I get : TypeError: Cannot read properties of undefined (reading 'has').
Later edit and solved!
There was a typo: visibleChats and not visibileChats.
Please or to participate in this conversation.