-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
Can v-for have local variables? #12088
Comments
it could be this?
|
@Killea No, I don't want to repeat. |
Please search v-scope in issues and PR. This was dropped |
There is a trick to achieve it, but I think an official support will be nice. <ul>
<template v-for="v in list">
<template v-for="isActive in [v.id === currentId]">
<li :class="{ 'active': isActive }">
{{ isActive ? 'active' : 'not active' }}
</li>
</template>
</template>
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this feature solve?
Repeated comparisons: v.id === currentId
What does the proposed API look like?
Define a local variable: isActive
The text was updated successfully, but these errors were encountered: