Vue如何循環(huán)提取對(duì)象數(shù)組中的值
1.數(shù)據(jù)如下,提取name和callcount
2代碼.
getQueryCallStatistics("sesp1", this.provinceId).then((res) => { let arr = []; let arr1 = []; let arr2 = []; let arr3 = []; let arr4 = []; this.xunshiMap = res.data.callstatistics; res.data.callstatistics.forEach((element) => { // arr.push([ // element.name, // element.callcount.patrol, // element.callcount.repair, // element.callcount.defect // ]); arr.push([element.name, 27, 38, 27]); arr1.push(element.name); arr2.push({ value: element.callcount.defect, name: element.name,type: element.name }); arr3.push({ value: element.callcount.patrol, name: element.name,type: element.name }); arr4.push({ value: element.callcount.repair, name: element.name,type: element.name }); // arr2.push({ value: 27, name: element.name }); // arr3.push({ value: 27, name: element.name }); // arr4.push({ value: 38, name: element.name }); }); this.xunshiMap = arr; this.xunshiPer = arr1; this.xunshiPer1 = arr2; this.qxArr = arr4; this.xqArr = arr2; this.xsArr = arr3; setTimeout(this.renderEachCity, 0); this.echartCity(); });
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
vue實(shí)現(xiàn)條件判斷動(dòng)態(tài)綁定樣式的方法
今天小編就為大家分享一篇vue實(shí)現(xiàn)條件判斷動(dòng)態(tài)綁定樣式的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-09-09Vue如何根據(jù)角色獲取菜單動(dòng)態(tài)添加路由
這篇文章主要介紹了Vue如何根據(jù)角色獲取菜單動(dòng)態(tài)添加路由,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2024-01-01VueJs單頁(yè)應(yīng)用實(shí)現(xiàn)微信網(wǎng)頁(yè)授權(quán)及微信分享功能示例
本篇文章主要介紹了VueJs單頁(yè)應(yīng)用實(shí)現(xiàn)微信網(wǎng)頁(yè)授權(quán)及微信分享功能示例,具有一定的參考價(jià)值,有興趣的可以了解一下2017-07-07vue插件draggable實(shí)現(xiàn)拖拽移動(dòng)圖片順序
這篇文章主要為大家詳細(xì)介紹了vue插件draggable實(shí)現(xiàn)拖拽移動(dòng)圖片順序,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-12-12Vue3項(xiàng)目中引入ElementUI并使用的示例詳解
ElementUI是一個(gè)強(qiáng)大的PC端UI組件框架,它不依賴于vue,但是卻是當(dāng)前和vue配合做項(xiàng)目開(kāi)發(fā)的一個(gè)比較好的ui框架,本文主要介紹了如何在vue3中引入使用ElementUI,需要的可以參考一下2023-06-06VueJS 集成 Medium Editor的示例代碼 (自定義編輯器按鈕)
本篇文章主要介紹了VueJS 集成 Medium Editor的示例代碼 (自定義編輯器按鈕),具有一定的參考價(jià)值,有興趣的可以了解一下2017-08-08Vue聯(lián)動(dòng)Echarts實(shí)現(xiàn)數(shù)據(jù)大屏展示
這篇文章主要為大家介紹了Vue聯(lián)動(dòng)Echarts實(shí)現(xiàn)數(shù)據(jù)大屏的展示示例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-04-04