We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v-show
v-if
v-if 也是有惰性的,渲染条件为假,什么都不做,直至条件为真才开始渲染条件块。
一般来说,v-if 有更高的切换开销,而 v-show 有更高的初始渲染开销。因此,如果需要非常频繁地切换,则使用 v-show 较好;如果在运行时条件很少改变,则使用 v-if 较好。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
区别
v-show
是简单切换元素的 CSS display属性,显示 or 隐藏v-if
是“真正”的条件渲染,条件块内的事件监听器和子组件适当地销毁 or 重建总结
一般来说,v-if 有更高的切换开销,而 v-show 有更高的初始渲染开销。因此,如果需要非常频繁地切换,则使用 v-show 较好;如果在运行时条件很少改变,则使用 v-if 较好。
The text was updated successfully, but these errors were encountered: