You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to increment an h-var in a repeat?
Like in this example where I define a number, and only add the index if a condition in the repeat is true?
It loops through an array within my-element, and I want to keep track an h-var which should increment whenever an item is a regular item, the result now is this
0 info domestic
0 regular dog
0 regular cat
0 info wild animals
0 regular bear
0 info domestic
1 regular dog
2 regular cat
0 info wild animals
3 regular bear
I need the count to increment whenever an item is from a regular type, is this possible ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to increment an h-var in a repeat?
Like in this example where I define a number, and only add the index if a condition in the repeat is true?
I have a working example here, but not the incrementing part.
https://stackblitz.com/edit/vitejs-vite-ztmwpwst?file=index.html,src%2Fmy-element.ts,src%2Findex.css
It loops through an array within my-element, and I want to keep track an h-var which should increment whenever an item is a regular item, the result now is this
I need the count to increment whenever an item is from a regular type, is this possible ?
Beta Was this translation helpful? Give feedback.
All reactions