最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
VUE前端从后台请求过来的数据进行转换数据结构操作代码
时间:2020-11-11 编辑:袖梨 来源:一聚教程网
本篇文章小编给大家分享一下VUE前端从后台请求过来的数据进行转换数据结构操作代码,文章代码介绍的很详细,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。
代码如下:
let label(){ let _this = this; let _offset = (_this.pagination.currentPage - 1) * _this.pagination.pageSize let params ={ offset:_offset,//分页偏移量 limit:_limit,//分页查询数量 } labelView(",params).then(res=>{ _this.list = res.data.data _this.pagination.total = res.data.pagination.total; //转换数据 let treeDataArray = new Array(); const element = _this.list let obj={ name:"", isExpand:true, children:new Array() } treeDataArray.push(obj); for(let dd1 = 0;dd1<_this.list.length;dd1++){ const element = _this.list[dd]; let obj1 ={ root:true, isExpand:true, name:element['model'], children:new Array() } obj.children.push(obj1); for(let dd2 = 0;dd2
相关文章
- SpringBoot测试配置属性与web启动环境解析 10-24
- SpringBoot常用计量与bean属性校验和进制数据转换规则解析 10-24
- 工厂方法在Spring框架中的运用介绍 10-24
- SpringBoot热部署设置详解 10-24
- JavaScript二叉搜索树构建操作解析 10-12
- JavaScript二叉树及各种遍历算法讲解 10-12