Similarities and differences between wx:if and hidden in WeChat applet
id
name
Same point
difference
0
wx:if
Display when true, not display false,都可以控制元素是否展示
When true, the element falseis in the view and displayed, when the element is not in the view,被销毁
1
hidden
Hide when true, display false,都可以控制元素是否展示
When the false and true, the view has that element, however, is truewhen, 隐藏up
Summary: Using hidden, no matter the value is true or false, the element will be loaded, wx:if, only when it is true, will it be loaded.所以,可以在切换频率较少的时候使用wx:if,减少资源的使用, 切换较多的地方使用hidden,提高用户体验.