x-if inside of x-for does not work #908
Replies: 4 comments 6 replies
-
How about putting it on the same Alternatively I think you can do <template x-for=...>
<div><template x-if=...></template></div>
</template> |
Beta Was this translation helpful? Give feedback.
-
I would try filtering the list and looping that instead: |
Beta Was this translation helpful? Give feedback.
-
hmmm, When specifying both For now, the solution seems to be:
✅ |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue but I'm using a function for the x-if variable value.
I have console.log inside each function and it logs the results (and execution) of both functions, bool for isDisplayed() and int for showTotal() but nothing inside the x-if template gets displayed. When I run this only "TEXT 1" appears on screen even when the isDisplayed() function returns true. I tried the solutions listed before but had no change in results. What am I missing? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
https://codepen.io/markfirmware/pen/vYXNBNX
only the first list item is included
Beta Was this translation helpful? Give feedback.
All reactions