vue中使用echarts插件时获取数组的所有属性(key)和(value)
1 methods: { 2 getKeys(object) { 3 let keys = []; 4 for (let props in object){ 5 keys.push(props); 6 // console.log("查看数据", keys); 7 } 8 return keys; 9 }, 10 getValues(object){ 11 let values = []; 12 for (var props in object){ 13 values.push(object[props]); 14 // console.log("查看数据", vlaues); 15 } 16 return values; 17 } 18 }