-
-
Save Mattchewone/cf6de6ca7b4c5329d57b8d52cd9da150 to your computer and use it in GitHub Desktop.
Reading data from the vuex store
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
computed: { | |
...mapGetters('messages', { | |
findMessagesInStore: 'find' | |
}) | |
}, | |
messages () { | |
const user = this.$store.state.auth.user | |
return this.findMessagesInStore({ query: { $or: [{ to: user._id }, { from: user._id }] } }).data | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment