feat: add mention menu to publish & replies

This commit is contained in:
Ricardo Arturo Cabral Mejia 2022-01-30 02:12:52 +00:00
parent 550d356bd3
commit 12041956b0
No known key found for this signature in database
GPG Key ID: 8949679922214342
2 changed files with 38 additions and 1 deletions

View File

@ -3,6 +3,7 @@
<q-card-section>
<q-form @submit="sendPost">
<q-input
ref="input"
v-model="text"
autogrow
autofocus
@ -44,9 +45,27 @@ export default {
data() {
return {
text: ''
text: '',
}
},
computed: {
textarea() {
return this.$refs.input.$el.querySelector('textarea')
},
mentions() {
return this.createMentionsProvider()
}
},
mounted() {
this.mentions.attach(this.textarea)
},
beforeUnmount() {
this.mentions.detach(this.textarea)
},
methods: {
async sendPost() {
if (!this.text.length) {

View File

@ -1,6 +1,7 @@
<template>
<q-form class="px-24" @submit="sendReply">
<q-input
ref="input"
v-model="text"
autogrow
autofocus
@ -32,6 +33,23 @@ export default {
}
},
computed: {
textarea() {
return this.$refs.input.$el.querySelector('textarea')
},
mentions() {
return this.createMentionsProvider()
}
},
mounted() {
this.mentions.attach(this.textarea)
},
beforeUnmount() {
this.mentions.detach(this.textarea)
},
methods: {
async sendReply() {
if (!this.text.length) {