src_js/iconolab-bundle/src/components/editor/Comment.vue
author Alexandre Segura <mex.zktk@gmail.com>
Wed, 22 Feb 2017 18:32:39 +0100
changeset 351 2d5557c01f95
parent 323 55c024fc7c60
child 391 7ab1cc12827e
permissions -rw-r--r--
Change design of right side panel.

<template>
    <div class="comment">
        {{ comment }}
        <div class="comment-footer">
            <span class="comment-author">{{ username }}</span>
            <span class="comment-date">{{ dateFormatted }}</span>
        </div>
    </div>
</template>

<script>

    export default {
        props: [
            'comment',
            'username',
            'email',
            'date'
        ],
        computed: {
            dateFormatted: function () {

                var date = new Date(this.date);

                var day = date.getDate();
                var month = date.getMonth() + 1;
                var year = date.getFullYear();

                return day + '/' + month + '/' + year;
            }
        }
    }

</script>

<style scoped>
.comment {
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 1px solid #ccc;
}
.comment-footer {
    margin-top: 5px;
    color: #ccc;
}
.comment-date {
    float: right;
}
</style>