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