Is there a way to update the time property, messagesList in VueCLI, with the current time when a button is clicked? The time property should have both integer and decimal parts. For example: (23.14)
Here is the available data:
messagesList : [
{
id : 1,
content : "My message",
opposite : false,
me : true,
time : 23.13,
},
{
id : 2,
content : "Opposite party's message",
opposite : true,
me : false,
time : 23.13,
}
],
Here is the code snippet for adding new messages:
this.messagesList.push(
{
id : this.messagesList.length + 1,
content : this.inputText,
opposite : false,
me : true,
time : ?,
}