add avatar on account-settings

This commit is contained in:
yogesh_gohil
2019-11-21 18:45:22 +05:30
parent 4ec34550ed
commit 812afc2dab
18 changed files with 262 additions and 28 deletions

View File

@ -58,7 +58,7 @@
aria-expanded="false"
class="avatar"
>
<img src="/images/avatar.png" alt="Avatar">
<img :src="ProfilePicture" alt="Avatar">
</a>
<v-dropdown-item>
<router-link class="dropdown-item" to="/admin/settings">
@ -83,7 +83,25 @@
import { mapGetters, mapActions } from 'vuex'
export default {
computed: {
...mapGetters('userProfile', [
'user'
]),
ProfilePicture () {
if (this.user && this.user.avatar !== null) {
return this.user.avatar
} else {
return '/images/default-avatar.jpg'
}
}
},
created () {
this.loadData()
},
methods: {
...mapActions('userProfile', [
'loadData'
]),
...mapActions({
companySelect: 'changeCompany'
}),