-
I've been creating dynamic components in a {% for.... %) loop just fine by using the component name directly in the for loop. When would I want to use |
Beta Was this translation helpful? Give feedback.
Answered by
wrabit
Aug 31, 2024
Replies: 2 comments
-
Show me the code you are using to do as you say. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@ra-dave I don't have to reach for it very often, but there are times. An example: # context
{'icons': [ 'pencil', 'pencil-square', 'pencil-circle', ... ] } <!-- icons are saved in:
cotton/pencil.html
cotton/pencil_square.html
...
-->
{% for icon in icons %}
<c-component :is="icon" />
{% endfor %} Or they might be in subfolders: {% for icon in icons %}
<c-component is="subfolder.{{ icon }}" />
{% endfor %} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
wrabit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ra-dave I don't have to reach for it very often, but there are times. An example:
Or they might be in subfolders: