我將很多數(shù)據(jù)都push到data中的一個字段中了:data() { return { networkInterfacesConfig: [],method() 其中一個for (let NetworkInterfaceName in networkInterfacesConfigJson) { let NetworkInterfaceInfo = networkInterfacesConfigJson[NetworkInterfaceName]; this.networkInterfacesConfig.push(NetworkInterfaceInfo);};按理來講 this.networkInterfacesConfig應(yīng)該是數(shù)組,但是當(dāng)我用另外一個 method 調(diào)用的時(shí)候,forEach、for...in、for...of 都無法處理,會被直接跳過。使用JSON.stringify后就直接變成空的了。執(zhí)行console.log(this.networkInterfacesConfig)發(fā)現(xiàn)是這種東西:原型是數(shù)組,還有長度,但是js原生的遍歷語句都不能使用,直接掉這個玩意的.length也是0該怎么辦?
vue如何在后端遍歷在組件data中的數(shù)組?
動漫人物
2019-03-06 18:33:02