一、给个容器
二、获取数据
mounted(){ this._getCategory() },
_getCategory(){
getCategory().then(res=>{
let data = res.data.data
this.bookCategory(this.formatData(data))
})
},
formatData(data){
let indicator = []
let bookCat = []
let borrowCat = []
data.book.forEach(info => {
let key = info.category;
let value = info.number;