[
{name:a,id:""},
{name:c,id:"d"},
{name:b,id:""},
{name:y,id:"d"},
{name:s,id:6},
{name:p,id:3},
]
how does the data from the background replace all the empty ones with"-"
[
{name:a,id:""},
{name:c,id:"d"},
{name:b,id:""},
{name:y,id:"d"},
{name:s,id:6},
{name:p,id:3},
]
how does the data from the background replace all the empty ones with"-"
just write a regular replace replacement, right? Your data is not embedded deeply,
let arr = JSON.parse (data)
arr = arr.map (e = > {.e, id: e.id =''?'-': e.id})
can be replaced when displayed on the page, and there is no need to change the array. If you have to change the array, you can do this:
arr.forEach(v=>{
if(v.id == "") {
v.id = "-";
}
});
Previous: Failed to start springboot project
Next: Mysql the string I saved is long. Do you want to set the length by using the text type?
http: wechat.cnzjcf.com Sele. my server just hangs a blank txt document and its access speed is not as fast as his ...