0: description: "Highest Intent"intent_id: 1intent_level: "highest"num_of_accounts: 0__proto__: Object1:
1: {intent_id: 2, intent_level: "high", description: "High Intent", num_of_accounts: 0}
2: {intent_id: 3, intent_level: "medium", description: "Medium Intent", num_of_accounts: 0}
3: {intent_id: 4, intent_level: "low", description: "Low Intent", num_of_accounts: 0}length: 4__proto__: Array(0).
在这里,我需要访问“高”或“中”或“低”的intent_level。
axios.get(“ / some_api /”,{ 异步:错误, 参数:{ client_id:clientObj.id, 指标:“意图”, campaign_id:campaign_id, from_date:moment.tz(this.state.intentStartDate,clientObj.timezone_name).format(“ YYYY-MM-DD”), to_date:moment.tz(this.state.intentEndDate,clientObj.timezone_name).format(“ YYYY-MM-DD”) } })。then(res => { console.log(res); console.log(res.data.metric_data); console.log(res.data.metric_data); console.log(res.data.campaign_id); console.log(res.data.intent_level); 让intent_obj = new Object(); res.data.metric_data.forEach( 功能(d){ intent_obj [d.intent_level] = d.num_of_accounts个 console.log(“ vvsv” + d.intent_level); in1_level = d.intent_level; }
);
});