Vue case where there is no table of FIG switching echart displayed or displayed unsuitable

Problem Description: The question is, echart FIG first page, the initial entry normal, but switched to the second page, and then point back to the first page, FIG not displayed or the emergence of the first page in FIG other pages

Solve: v-if replaced with v-show

Details: Actually, the problem is very simple, it is time to learn the difference between regular basis to see the v-if's and v-show

v-if: the element does not exist, for frequent switching

v-show: element exists, but the display properties to hide, for frequent switching

Some might also say that when v-if switched let echart rendered just once a thing! I did this, monitor the variable control switch and then re-render echart, so why can not it? I think because echart first to find the container prior to rendering, get the size of the container, acquired by the ref has always been virtual DOM, DOM in v-if show when he could not find a container.

Often using the v-if they forget there is a presence of v-show, are using non-standard grammar blame.

Part of the explanation is purely personal understanding, rookie a deep understanding, if not correct, but also look criticism!

Published 16 original articles · won praise 2 · views 20000 +

Guess you like

Origin blog.csdn.net/deciduous_leaves/article/details/104903941
Recommended