mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Pass entire user collection to Editor
This commit is contained in:
parent
2529c62137
commit
f760f37186
@ -16,6 +16,7 @@
|
|||||||
/>
|
/>
|
||||||
<no-ssr>
|
<no-ssr>
|
||||||
<hc-editor
|
<hc-editor
|
||||||
|
:users="users"
|
||||||
:value="form.content"
|
:value="form.content"
|
||||||
@input="updateEditorContent"
|
@input="updateEditorContent"
|
||||||
/>
|
/>
|
||||||
@ -125,6 +126,22 @@ export default {
|
|||||||
// this.form.content = value
|
// this.form.content = value
|
||||||
this.$refs.contributionForm.update('content', value)
|
this.$refs.contributionForm.update('content', value)
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
apollo: {
|
||||||
|
User: {
|
||||||
|
query() {
|
||||||
|
return gql(`{
|
||||||
|
User {
|
||||||
|
id
|
||||||
|
name
|
||||||
|
slug
|
||||||
|
}
|
||||||
|
}`)
|
||||||
|
},
|
||||||
|
result(result) {
|
||||||
|
this.users = result.data.User
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -197,6 +197,7 @@ export default {
|
|||||||
EditorMenuBubble
|
EditorMenuBubble
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
users: { type: Array, default: () => [] },
|
||||||
value: { type: String, default: '' },
|
value: { type: String, default: '' },
|
||||||
doc: { type: Object, default: () => {} }
|
doc: { type: Object, default: () => {} }
|
||||||
},
|
},
|
||||||
@ -227,12 +228,9 @@ export default {
|
|||||||
}),
|
}),
|
||||||
new History(),
|
new History(),
|
||||||
new Mention({
|
new Mention({
|
||||||
items: () => [
|
items: () => {
|
||||||
{ id: 1, name: 'Philipp Kühn' },
|
return this.users
|
||||||
{ id: 2, name: 'Hans Pagel' },
|
},
|
||||||
{ id: 3, name: 'Kris Siepert' },
|
|
||||||
{ id: 4, name: 'Justin Schueler' }
|
|
||||||
],
|
|
||||||
onEnter: ({ items, query, range, command, virtualNode }) => {
|
onEnter: ({ items, query, range, command, virtualNode }) => {
|
||||||
this.query = query
|
this.query = query
|
||||||
this.filteredUsers = items
|
this.filteredUsers = items
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user