数组对象转换
detail(valid, valname, valtagid, valdesc, valtagname) { //详情
var tagArray = valtagid.split(",") //将字符串变成数组
var valtagidArray = tagArray.slice(1)//截取调数组的第一项
var valtagnameArray = valtagname.split(",")
var dynamicTags2 = [];
for(var i = 0; i < valtagidArray.length; i++) { //将俩个数组合并为一个数组里面有俩对象,
var item = {};
item['id'] = valtagidArray[i];
item['name'] = valtagnameArray[i];//因为俩数组的长度一样,可以写在一个for循环
dynamicTags2.push(item);
}
this.dynamicTags1 = dynamicTags2;
console.log(this.dynamicTags1)
this.editform.name = valname;
this.editform.describe = valdesc;
this.tagid = valid;
},