init(){
this.$http.get('/share/backe', {
station_id: 2
}).then(res => {
if (res.data.result = 1) {
res.data.data.forEach(item => {
this.testList.push({
id: item.back_id,
name: item.back_name,
children:this.children
})
//子属性取id和name
item.children.forEach(items => {
this.children.push({
id: items.back_id,
name: items.back_name
})
})
this.range = this.testList; //赋值给range列表
console.log(this.testList)
});
}
})
},
vue 循环接口 使用数组值里的数组值
最新推荐文章于 2024-07-08 15:38:00 发布