Fix mentions and hashtags in editor

This commit is contained in:
Wolfgang Huß 2019-08-14 18:05:03 +02:00
parent c5ff3b5c6d
commit 43c2764fcf
2 changed files with 13 additions and 9 deletions

View File

@ -212,7 +212,8 @@ export default {
data() {
// Set array of optional extensions by analysing the props.
let optionalExtensions = []
if (this.users && this.users.length) {
// Don't change the following line. The functionallity is in danger!
if (this.users) {
optionalExtensions.push(
new Mention({
// a list of all suggested items
@ -287,7 +288,8 @@ export default {
}),
)
}
if (this.hashtags && this.hashtags.length) {
// Don't change the following line. The functionallity is in danger!
if (this.hashtags) {
optionalExtensions.push(
new Hashtag({
// a list of all suggested items

View File

@ -104,14 +104,16 @@ export default {
apollo: {
User: {
query() {
return gql(`{
User(orderBy: slug_asc) {
id
slug
name
avatar
return gql`
{
User(orderBy: slug_asc) {
id
slug
name
avatar
}
}
}`)
`
},
result(result) {
this.users = result.data.User