VUE 取数组交集
时间:2022-03-29 01:44
//produceTypeList-produceType:存在produceTypeList中不存在produceType中 let diff1 = produceTypeList.filter(function(v){ return produceType.indexOf(v) === -1 }).join(",") //produceType-produceTypeList:存在produceType中不存在produceTypeList中 let diff2 = produceType.filter(function(v){ return produceTypeList.indexOf(v) === -1 }).join(",")