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

第69题:v-if 和 v-show有什么区别? #69

Open
noxussj opened this issue Jun 18, 2020 · 0 comments
Open

第69题:v-if 和 v-show有什么区别? #69

noxussj opened this issue Jun 18, 2020 · 0 comments
Labels

Comments

@noxussj
Copy link
Owner

noxussj commented Jun 18, 2020

以上两者在元素展示的效果其实是相同的,只是在隐藏元素的时候效果会有区别

  • v-if元素隐藏时,会在dom节点中把该元素移除

  • v-show元素隐藏时,会在dom节点中把该元素设置css属性为display : none,元素依然保留在dom节点中

@noxussj noxussj added the Vue label Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant