x-for and template not working with nested elements #4401
Answered
by
SimoTod
florian-sun
asked this question in
1. Help
-
Let's say we have a template with an x-for and a list item. If the list item contains, say, a button, it doesn't appear. It looks like x-for clones the template content but only the first level, the button is not cloned. |
Beta Was this translation helpful? Give feedback.
Answered by
SimoTod
Oct 17, 2024
Replies: 1 comment 8 replies
-
![]() wrap it to one element |
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
You can use a span tag
Re
So I guess x-text shd only set the text not the whole content of an element.
how would you decide where to put the text?<li>item1<button>test1</button><li>
vs<li><button>test1</button>item1<li>
vs<li><button>test1</button>item1<button>test1again</button><li>
It would just open a can of worms because different devs have different use cases.