-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Description
What problem does this feature solve?
Sometimes we need to compute and reference the same value multiple times in a template.
It would help with readability & performance to be able to define variables in templates.
Somebody asked this here too:
https://stackoverflow.com/questions/43999618/how-to-define-a-temporary-variable-in-vue-js-template
What does the proposed API look like?
There's a suggestion in the answers, but this allows setting only 1 variable:
<li v-for="id in users" :key="id" :set="user = getUser(id)">
maybe like this?
<li v-for="id in users" :key="id" :set="user = getUser(id); var2 = true; var3=getUserPrefs(id)">
klesun, ArturFormella, rajmondburgaj and SeregPie
Metadata
Metadata
Assignees
Labels
No labels