The problem of transferring vue array to object, a chat function

websocket returns a string, the former is the user name of the message sent by the other party, and the latter is the message, and then I use split (",") to convert it into an array, such as

when console comes out.
Object {Category: "chat", Content: "andy321 , Hello World"} "/"
["andy321 ", " Hello World"]

here is an object that starts with name. How can I add Hello World to myChat? according to andy321
name


Aug.18,2021

Hello, landlord! You can try:

var Obj = {...};
var message = ["andy321 ", " Hello World"];
Obj[message[0].trim()].push({myChat: message[1].trim()});
Menu