admin管理员组

文章数量:1396102

I'm new to reactjs, the column 'Savings" does not appear on the screen when I do click on a print button that uses window.print() native javascript, just to print into PDF format.

On the computer screen it does appear, in the PDF it does not appear.

I see that the variable id_savings have no value at the preview of window printing.

Into the tableBody.js reactjs component:

{id_savings >= 12 && <th>Savings</th> }

and:

{
  id_savings >= 12 && 
    <td>
      {data.ind_savings === 1 ? 'Yes' : 'No'}
    </td>
}

I just call using onClick() the function:

printScreen = () => {
  window.print();
};

本文标签: onclickReactjs how to print data using windowprint native JSStack Overflow