pleroma-fe/src/components/mentions_line/mentions_line.js

39 lines
740 B
JavaScript
Raw Normal View History

import MentionLink from 'src/components/mention_link/mention_link.vue'
import { mapGetters } from 'vuex'
const MentionsLine = {
name: 'MentionsLine',
props: {
mentions: {
required: true,
2021-06-09 00:04:57 +10:00
type: Array
}
},
data: () => ({ expanded: false }),
components: {
MentionLink
},
computed: {
limit () {
return 2
},
mentionsComputed () {
return this.mentions.slice(0, this.limit)
},
extraMentions () {
return this.mentions.slice(this.limit)
},
manyMentions () {
return this.extraMentions.length > 0
},
2021-06-08 21:51:42 +10:00
...mapGetters(['mergedConfig'])
},
methods: {
toggleShowMore () {
this.expanded = !this.expanded
}
}
}
export default MentionsLine