logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

mentions_line.js (744B)


  1. import MentionLink from 'src/components/mention_link/mention_link.vue'
  2. import { mapGetters } from 'vuex'
  3. export const MENTIONS_LIMIT = 5
  4. const MentionsLine = {
  5. name: 'MentionsLine',
  6. props: {
  7. mentions: {
  8. required: true,
  9. type: Array
  10. }
  11. },
  12. data: () => ({ expanded: false }),
  13. components: {
  14. MentionLink
  15. },
  16. computed: {
  17. mentionsComputed () {
  18. return this.mentions.slice(0, MENTIONS_LIMIT)
  19. },
  20. extraMentions () {
  21. return this.mentions.slice(MENTIONS_LIMIT)
  22. },
  23. manyMentions () {
  24. return this.extraMentions.length > 0
  25. },
  26. ...mapGetters(['mergedConfig'])
  27. },
  28. methods: {
  29. toggleShowMore () {
  30. this.expanded = !this.expanded
  31. }
  32. }
  33. }
  34. export default MentionsLine