ratiw / vuetable-2

data table simplify! -- datatable component for Vue 2.x. See documentation at
https://vuetable.com
MIT License
2.15k stars 399 forks source link

infinite loop loading when using loader divs with v-if #405

Open d3bgger opened 6 years ago

d3bgger commented 6 years ago

I don't know if i'm doing something wrong, or this is a vue bug, or a vuetable bug.

https://codepen.io/anon/pen/EEXewo

I just added some divs that are shown when vuetable is loading. When using v-if, there is an infinite loop (when completed loading, vuetable starts loading again). If v-show is used, instead of v-if in these divs... then there is no problem.

thanks

ratiw commented 6 years ago

@nkwinder It's a bit strange. Try changing v-if to v-show instead.

d3bgger commented 6 years ago

Yes as i said v-show is working. Changing the div order also works... (moving the overlay div before vuetable). But this is very strange behavior and i would like to know whats the problem here.

ratiw commented 6 years ago

I don't know for sure what caused it, but I guess that v-if might have forced re-evaluation of the component as it reinsert the dom. This is not happening with v-show as it only show/hide the dom.