-
|
Hello, I am building a report system and I would like to define components for each report section (charts, ect.). I would then like to store the list of report sections in the database so each report can be different. As part of the report section model, I'd like to store a cotton component so the display of the reports is data driven. How would you recommend rendering the appropriate cotton component based on some identifying data passed to the template that was stored in the DB, for instance the component name (c-some.component)? |
Beta Was this translation helpful? Give feedback.
Answered by
wrabit
Jun 12, 2025
Replies: 1 comment
-
{% for section in sections %}
<c-component :is="section" />
<!-- or, if it's in subfolder -->
<c-component is="some.sub.{{ section }}-component" />
{% endfor %} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
curvedinf
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{% for section in sections %} <c-component :is="section" /> <!-- or, if it's in subfolder --> <c-component is="some.sub.{{ section }}-component" /> {% endfor %}More