vikunja-frontend/src/components/misc/user.vue

59 lines
899 B
Vue
Raw Normal View History

2019-11-24 14:16:24 +01:00
<template>
<div :class="{'is-inline': isInline}" class="user">
<img
:height="avatarSize"
:src="user.getAvatarUrl(avatarSize)"
:width="avatarSize"
alt=""
class="avatar"
v-tooltip="user.username"/>
<span class="username" v-if="showUsername">{{ user.username }}</span>
2019-11-24 14:16:24 +01:00
</div>
</template>
<script>
export default {
name: 'user',
props: {
user: {
required: true,
type: Object,
2019-11-24 14:16:24 +01:00
},
showUsername: {
required: false,
type: Boolean,
default: true,
},
avatarSize: {
required: false,
type: Number,
default: 50,
},
isInline: {
required: false,
type: Boolean,
default: false,
},
},
}
2019-11-24 14:16:24 +01:00
</script>
<style lang="scss" scoped>
.user {
margin: .5em;
2019-11-24 14:16:24 +01:00
&.is-inline {
display: inline;
}
img {
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
border-radius: 100%;
2019-11-24 14:16:24 +01:00
vertical-align: middle;
margin-right: .5em;
2019-11-24 14:16:24 +01:00
}
}
2019-11-24 14:16:24 +01:00
</style>