uitablediv
use the createPortal method. You can only insert a div, below the table. It is not the desired result. Consult the experienced god.
uitablediv
use the createPortal method. You can only insert a div, below the table. It is not the desired result. Consult the experienced god.
you just wrap him a layer in render
operate
in componentDidMount
of outer components, such as App components
// App.js
componentDidMount() {
const table = document.getElementById('main-table');
const div = document.createElement('div');
const cloneTable = table.cloneNode(true);
div.appendChild(cloneTable);
table.parentElement.replaceChild(div, table);
}
never operate dom
in react
.
maybe you are already familiar with jquery
, and use jquery
thinking in react
to solve problems.
it is difficult to troubleshoot the problems caused by dom
.
for example:
obviously the value of state
has changed, but the page is not render
.
Previous: The current-page.sync event in element-ui highlights the wrong page number?
Next: Vw layout is introduced on the basis of vant-ui, and warning appears.