How to correctly wrap few TD tags for JSXTransformer?

前端 未结 4 682
长发绾君心
长发绾君心 2020-12-13 08:14

I have an array with items and I want to make something like this:


(until have items in array
)
         


        
4条回答
  •  时光说笑
    2020-12-13 09:12

    So you have pairs of elements which you want to return from a .map. The easiest way to do this is to just wrap them in an array.

    
      {data.map(function(x, i){
        return [
          {x[0]},
          {x[1]}
        ];
      })}
    
    

    Don't forget the comma after the first .

提交回复
热议问题