[Solved] Is that possible to create UI elements dynamically?
-
Dear Quasar team,
Like the title, I would like to create UI element (E.g. Q-Input, Q-Date) dynamically. How many UI elements to display is determined by back-end service.
So is that possible? Maybe this question can go up to Vue level.
Any proposal will be appreciate. -
@Stanley sure! nice example here:
https://github.com/baggachipz/q-form-builderyou can see whats already possible here:
https://github.com/quasarframework/quasar-awesome -
here’s some more info about dynamic components:
https://vuejs.org/v2/guide/components.html#Dynamic-Components
https://blog.logrocket.com/how-to-make-your-components-dynamic-in-vue-js/
https://dev.to/deepaksisodiya/working-with-dynamic-components-in-vue-js-56agYou could also go a step further and make the entire template come from a server (e.g. Ajax call):
https://www.digitalocean.com/community/tutorials/vuejs-v-runtime-template -