四十、操作数组不改变原数组的值
getCurrentUserIds(){ this.searchRequest("/trainingActivityAuditing/getCurrentUserIds").then(resp => { this.addForm.originatorName = resp.data.data; //部门id var val = []; debugger var arr = resp.data.data;
//slice会返回一个新数组,不会修改原数组 val = arr.slice(); val = val.splice(0,val.length-1) this.showId = val.join(","); }) },