假如說我現在有一段這樣的數據type=line&areaStyle.show=true&lineStyle.normal.color=#000&lineStyle.normal.width=2type=bar&areaStyle.show=false&lineStyle.normal.color=#fff&lineStyle.normal.width=從數據中我們可以看出從type開始到lineStyle.normal.width結束重復了,我需要的是重復了幾次就往數組里塞幾個對象,以上重復了兩段那么最終的格式如下,我是一點都摸不著頭緒,js這方面比較弱,望大神指點,最好能簡單闡述下思路我可以慢慢研究[{ type:'line', areaStyle:{ show:true }, lineStyle:{ normal:{ color:'#000', width:2 } }},{ type:'bar', areaStyle:{ show:true }, lineStyle:{ normal:{ color:'#fff' width: } }},]
數據轉化的問題
DIEA
2018-12-12 18:18:16