vue 获取对象数组的某个属性并拼接成字符串

vue 获取对象数组的某个属性并拼接成字符串
function submitForm1() {
   //RefChilde.value.selectOption 为自组件的数组对象
  if (!RefChilde.value.selectOption) {
    proxy.$modal.msgWarning("请选择一条信息。");
    return;
  }
  form.value.exSubjectId = RefChilde.value.selectOption
    .map((item) => item.id)
    .join(",");
  form.value.exSubjectTitle = RefChilde.value.selectOption
    .map((item) => item.exTitle)
    .join(",");
  open1.value = false;
}


后端java实现
list.stream().map(TaskBusiness::getReceivePersonId).collect(Collectors.joining(","))
 

 

posted @ 2022-08-05 16:41  Spock123  阅读(241)  评论(0编辑  收藏  举报