Skip to content
New issue

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

【Vue.js】v-if与v-show区别 #12

Open
dongtong opened this issue May 1, 2016 · 0 comments
Open

【Vue.js】v-if与v-show区别 #12

dongtong opened this issue May 1, 2016 · 0 comments

Comments

@dongtong
Copy link
Owner

dongtong commented May 1, 2016

  • 当使用v-if时,如果在初始化渲染的时候条件为false, 那么不会做任何事情。
  • v-if 首次局部编译不会发生,知道条件变为true。
  • 总体来说v-if切换显示内容的消耗更高,而v-show在初始化渲染的消耗更高。
  • 如果经常要切换显示内容使用v-show, 而在运行时显示条件不可能经常变化的使用v-if。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant