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

55.Vue 中 为什么避免 v-if 和 v-for 用在一起 #55

Open
wqjiao opened this issue May 11, 2020 · 0 comments
Open

55.Vue 中 为什么避免 v-if 和 v-for 用在一起 #55

wqjiao opened this issue May 11, 2020 · 0 comments

Comments

@wqjiao
Copy link
Owner

wqjiao commented May 11, 2020

当 Vue 处理指令时,v-for 比 v-if 具有更高的优先级,通过v-if 移动到容器元素,不会再重复遍历列表中的每个值。取而代之的是,我们只检查它一次,且不会在 v-if 为否的时候运算 v-for

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