Is it better to use v-if on the component or the highest-level div in the component to be controlled by v-if? what are the advantages and disadvantages?

component:

</editor>
      </main>
    </el-dialog>
  </div>
Dec.17,2021

whatever. Anyway, v-if/v-show also acts on the component root element, and the difference is only that big.


of course, it is better to put it on the outer layer. Partial compilation starts only when the condition becomes true for the first time, and the custom component needs to be parsed internally, which wastes performance


. The examples given are all placed on the component, and there is no difference in the diagram given. Components are compiled when v-if is true and can be used in combination with < keep-alive > built-in components to optimize performance.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37c8f-2b90a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37c8f-2b90a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?