0👍
Move the newMessage
within .then()
. You can try debug by adding console.log
after newMessage
was cleared and see whats the output.
onSendMessage() {
if (this.newMessage != "") {
let currentDate = Date()
firebase
.push("/messages/" + this.chatId, {
message: this.newMessage,
sender: this.getUserID,
timestamp: currentDate,
})
.then(function (result) {
console.log("created key: " + result.key);
this.newMessage = ""
});
}
},
- [Vuejs]-'index' is defined but never used. Error mesage, does anyone know how to fix it?
- [Vuejs]-SSR index.html compilation
Source:stackexchange.com