About the problem that WeChat Mini Programs wx:if will make the component life cycle execute many times.

because Mini Program"s router cannot display content in part of the page like vue-router, it is necessary to use eventbus when doing the bottom navigation bar, and Wechat wx:if, for the middle content, but wx:if will make the component"s hook function execute again. If wx:hidden, the front page loads too many interfaces, so how to solve


when using wx:hidden, you can pass a state into the component. For example, when there are four tab, switches, the tabId is passed to each component, and the component decides whether or not to do processing according to the current tabId. This prevents all component data from being loaded by default, but for the first time all components will definitely render

.
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-1b3af75-2b9d3.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-1b3af75-2b9d3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?