Skip to content
Snippets Groups Projects
Unverified Commit fa455549 authored by Christoph Wurst's avatar Christoph Wurst
Browse files

Add simple Vue avatar component

parent 1f4ad9c7
No related branches found
No related tags found
No related merge requests found
<template>
<div class="avatar"
:data-user="label"
data-size="32"
v-placeholder="label">{{ label | firstCharacter }}
</div>
</template>
<script>
export default {
name: "Avatar",
props: [
'label'
],
directives: {
placeholder: {
inserted: function (el, binding) {
$(el).imageplaceholder(binding.value, binding.value);
}
}
},
filters: {
firstCharacter (val) {
return val.charAt(0);
}
}
}
</script>
<template>
<div class="app-content-list-item">
<div class="app-content-list-item-icon">
<Avatar :label="from"/>
</div>
<div class="app-content-list-item-line-one"
:title="from">
{{from}}
......@@ -9,16 +12,21 @@
{{subject}}
</div>
<div class="app-content-list-item-details date">
<Moment timestamp="1536048354000" />
<Moment timestamp="1536048354000"/>
</div>
</div>
</template>
<script>
import Avatar from "./Avatar";
import Moment from "./Moment";
export default {
name: "MessageListItem",
components: {Moment},
components: {
Avatar,
Moment
},
props: [
'from',
'subject',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment