Guest User

Untitled

a guest
Jan 22nd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <template>
  2. <div class="details">
  3. <span v-if="!hideSubreddit" class="details__subreddit">{{ listing.subreddit_name_prefixed }}</span>
  4. <span class="details__time">{{ listing.created_utc | fromNow }}</span>
  5. <span class="details__author">{{ listing.author }}</span>
  6. </div>
  7. </template>
  8. <script>
  9. import moment from 'moment'
  10.  
  11. export default {
  12. props: ['listing', 'hideSubreddit'],
  13. filters: {
  14. fromNow(date) {
  15. return moment.unix(date).fromNow();
  16. }
  17. }
  18. }
  19. </script>
  20. <style lang="scss">
  21. .details {
  22. font-weight: 100;
  23. color: #aaa;
  24. overflow: hidden;
  25. word-break: break-all;
  26. height: 1.5em;
  27. &__subreddit {
  28. font-weight: bold;
  29. }
  30. &__time {
  31. font-size: 0.8em;
  32. }
  33. &__author {
  34. font-size: 0.9em;
  35. }
  36. }
  37. </style>
Add Comment
Please, Sign In to add comment