Answer the question
In order to leave comments, you need to log in
How can I make a type of chat but without a backend?
To save information, I use firebase realtime database
The idea is simple.
there is a text field and a button to add text to the object
<textarea v-model="textarea"></textarea>
<button @click="addText"> add</button>
data(){
return{
textarea:null,
texts:[ ]
}
},
methods:{
addText(){
this.texts.push({user:"admin", message:this.textarea})
}
}
<ul v-for="message in texts" :key="message">
<li><b>{{message.user}}</b> {{message.message}}</li>
</ul>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question