let str1 = JSON.stringify(data).replace(/{/g, "[") let str2 = str1.replace(/}/g, "]") let str3 = str2.replace(/"/g, "") let str4 = str3.replace(/:/g, "") var str5 = str4.substr(1); //删除首字符 var str6 = str5.substring(0, str5.length - 1); //删除最后末字符 this.optionList.forEach(element => { str6 = str6.replace(element, ""); }); this.optionList.forEach(element => { str6 = str6.replace(element, ""); }) this.optionList.forEach(element => { str6 = str6.replace(element, ""); }) console.log(str6,'fee') let list1 = str6.split(',') console.log(list1, '的份额') return
标签:逻辑,str6,js,replace,let,str5,element,替换,forEach From: https://www.cnblogs.com/yn-cn/p/17250309.html