mirror of
https://github.com/styppo/hamstr.git
synced 2024-10-18 13:33:22 +00:00
feat: add mention menu to publish & replies
This commit is contained in:
parent
550d356bd3
commit
12041956b0
@ -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) {
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user