vue for each循环出来数组的某一项 再重新合并成一个新数组
search() {
request
.get("/manager")
.then(res => {
if (res.code == 20000) {
this.tableData = res.data.list;
var categorystr = ''
var classifystr = ''
this.tableData.forEach(function(c) {
categorystr += c.category + ","
classifystr += c.classify + ","
});
categorystr = categorystr.substring(0,categorystr.length-1)
classifystr = classifystr.substring(0,classifystr.length-1)
this.categoryList = categorystr.split(",")
this.classifystr = classifystr.split(",")
// console.log(str)
// console.log(this.categoryList)
}
})
.catch(err => {
console.log(err);
});
不求大富大贵,但求一生平凡