分类:React
2020
11-03
1.写在前面作为前端小白的我一直对算法和数据结构浅尝辄止,哝,吃亏了。使用多次递归实现数据格式化后将数据进行树状展示的目的,分享一下我这次挠头的经历~2.数据后台传过来的数据大概是这样的{"data":[{"id":1,"name":"一级节点","parentId":0,"isValid":true,"canAddChild":true,"parent":null,"children":[]},{"id":3,"name":"二级节点","parentId":1,"isValid":true,"canAddChild":true,"parent":null,"chi...
继续阅读 >
2020
10-30
使用antdtable中显示一张图片,代码如下:constcolumns=[{title:"姓名",dataIndex:"name",width:100,//table列定宽可不设fixed:"left"//固定列的位置},{title:"联系电话",width:150,dataIndex:"phone"},{title:"显示一张图片",width:150,dataIndex:"img",render:(text)=><imgsrc={text}/>},{title:"显示多张图片",width:400,dataIndex:"imgs",render:text=>{//text是后端传的...
继续阅读 >