RT, I now need to have multiple input, on the front-end (vue) and generate a form in json format for post. The problem now is that I can"t store the input in input into an array format.
for example, the json format I need:
{
"name" :"test",
"mylists":[
{
"user_ids":[100, 200],
"group":"1"
},
{
"user_ids":[400,500],
"group":"2"
}
]
}
but now I can only get the following format:
{
"name" :"test",
"mylists":[
{
"user_ids":" 100, 200",
"group":"1"
},
{
"user_ids":" 400,500",
"group":"2"
}
]
}
my user_ids is all entered in the same input. For example, there are two input, inputs, the first input 100200 and the second input 400,500 instead of an input that corresponds to only one value. How can I store the json format I need in this situation? After input, the default is stirng, "100200". But what I need is an array of [100,200], which is in int format.