Created
August 21, 2019 15:53
-
-
Save dmytrostriletskyi/c1dcf5278038658e19d347302888b367 to your computer and use it in GitHub Desktop.
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
<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