react各个子元素绑定气泡以及数组循环创建元素

render: (text, cell) => {
        if ((cell.bill_type == 1310 || cell.bill_type == 1318) && cell.info.ladder_coeff && cell.info.ladder_coeff !== []) {
          const ladder_coeff = <div>
          {
            Object.keys(cell.info.ladder_coeff).map((itemKey,item) => {
              return <p key={itemKey}>{itemKey + ' : ' + cell.info.ladder_coeff[itemKey].toString()}</p>
            })
          }
          </div>
          return (
            <div>
              {text}
              <Popover
                content={ladder_coeff || ''}
                placement="topRight"
                title="阶梯计费成本系数"
                overlayStyle={{ width: 170, position: 'fixed', right: 20 }}
              >
                <Icon
                  type="zoom-in"
                />
              </Popover>
            </div>
          )
        } else {
          return text
        }
      }
发布了83 篇原创文章 · 获赞 18 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/HoeWang/article/details/89382400