vue解析ids成数组split(“,“)

this.queryParams.ids = this.selection.split(",");

let ids = []
this.selection.forEach((item)=>{
  ids.push(item.id)
})
this.queryParams.ids = ids;

//简写

this.queryParams.ids = this.selection.map(item => item.id);

你可能感兴趣的:(vue,前端)