Nested data-wp-each loops #63813
Closed
webconstructor
started this conversation in
Interactivity API
Replies: 1 comment 1 reply
-
Hey Inigo, it's not working because you have a If you move the <ul
data-wp-interactive="myPlugin"
data-wp-context='{ "list": [
{ "lang": "en", "value": ["hello","see ya"] },
{ "lang": "es", "value": ["hola","hasta luego"] },
{ "lang": "nl", "value": ["hallo", "tot ziens"] }
]
}'
>
<template data-wp-each--greeting="context.list">
<li>
<span data-wp-text="context.greeting.lang"></span>:
<template data-wp-each="context.greeting.value">
<span data-wp-text="context.item"></span>
</template>
</li>
</template>
</ul> You can see it in action on this StackBlitz: https://stackblitz.com/edit/vitejs-vite-kyfaej?file=index.html |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an array of data that contain objects.
I was wondering if something like
should work (which it doesn't right now) / is supported.
And if so, what would be the correct syntax...
Beta Was this translation helpful? Give feedback.
All reactions