Skip to content

is there a way to make a component with dynamics inputs ? #397

Answered by givanz
muhamedRadwan asked this question in Q&A
Discussion options

You must be logged in to vote

You can use the input group attribute that will set a data-group attribute on the input container

In the gallery component groups is used to show/hide inputs for masonry layout switch like images per rows

setGroup: group => {
document.querySelectorAll(".mb-3[data-group]").forEach(el => el.style.display = "none");
document.querySelector('.mb-3[data-group="'+ group + '"]').style.display = "";
},
onChange : function(node, value, input) {
this.setGroup(value);
return node;
},

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@muhamedRadwan
Comment options

Answer selected by muhamedRadwan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants