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