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-card-section>
|
||||||
<q-form @submit="sendPost">
|
<q-form @submit="sendPost">
|
||||||
<q-input
|
<q-input
|
||||||
|
ref="input"
|
||||||
v-model="text"
|
v-model="text"
|
||||||
autogrow
|
autogrow
|
||||||
autofocus
|
autofocus
|
||||||
@ -44,9 +45,27 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
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: {
|
methods: {
|
||||||
async sendPost() {
|
async sendPost() {
|
||||||
if (!this.text.length) {
|
if (!this.text.length) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<q-form class="px-24" @submit="sendReply">
|
<q-form class="px-24" @submit="sendReply">
|
||||||
<q-input
|
<q-input
|
||||||
|
ref="input"
|
||||||
v-model="text"
|
v-model="text"
|
||||||
autogrow
|
autogrow
|
||||||
autofocus
|
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: {
|
methods: {
|
||||||
async sendReply() {
|
async sendReply() {
|
||||||
if (!this.text.length) {
|
if (!this.text.length) {
|
||||||
|
Loading…
Reference in New Issue
Block a user