Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmytrostriletskyi/c1dcf5278038658e19d347302888b367 to your computer and use it in GitHub Desktop.
Save dmytrostriletskyi/c1dcf5278038658e19d347302888b367 to your computer and use it in GitHub Desktop.
<v-card>
<template v-for="(comment, index) in comments">
<v-list-item>
<v-list-item-avatar>
<img :src="getUserAvatarUrl(comment.user.username)">
</v-list-item-avatar>
</v-list-item>
</template>
</v-list>
</v-card>
methods: {
getUserAvatarUrl(username) {
store.dispatch(profileStorageActions.getProfile, {
username: username,
})
store.subscribe((mutation, state) => {
if (mutation.type === profileStorageMutations.subscribe.addProfile) {
return state.profile.avatarUrl
}
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment