Something like x-for but for repeating contents of an attribute?
#3733
trusktr
started this conversation in
3. Feature Ideas
Replies: 2 comments 9 replies
-
|
Would probably be smart to put them into actual data, but assuming they HAVE to be in the attributes <template x-for="box in [$el.getAttribute('colors').trim().split('\n'), $el.getAttribute('positions').trim().split('\n')].reduce((a,b) a.flatMap(color => b.map(pos => ({ color, pos })))">
<div x-text="box"></div>
</template>I believe you could also just directly use |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
I would use a getter https://codepen.io/SimoTod/pen/mdaVNMp |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I'm working on Lume, and with Lume elements we can do this:
where this will render three boxes on the screen, in three different colors, and at three different positions in 3D space (x y z).
It would be useful to be able to repeat the content of an attribute. I didn't see a way in the docs.
How might a new feature look like? Kinda tricky to make this one ergonomic.
or
Beta Was this translation helpful? Give feedback.
All reactions