We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is your feature request related to a problem? Please describe.
I'm always frustrated when I have to write multiple lines to append a few elements and text nodes. 😓
Describe the solution you'd like
A clear and concise description of what I want to happen is this:
pcui.Container.prototype.appendMany = function() { for (let i=0; i<arguments.length; i++) { let arg = arguments[i]; let node; if (typeof arg === 'string') { node = new pcui.Label({text: arg}); } else { node = arg; } this.append(node); } }
Which would be used like:
var key = document.createElement('code'); key.innerText = "pos"; var val = document.createElement('code'); val.innerText = '{x: 1, y: 2, z: 3}';
Appending everything with a single call while generating labels on the fly:
this.container.appendMany("Key: ", key, "Value: ", val);
It would create something like:
Describe alternatives you've considered
this.container.append(new pcui.Label({text:"Key: "})); this.container.append(key); this.container.append(new pcui.Label({text:"Value: "})); this.container.append(val);
This would mirror the original HTML DOM API specification, which would make pcui elements feel more natural (at least to me 😅).
pcui
Original HTML DOM API: https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
I'm always frustrated when I have to write multiple lines to append a few elements and text nodes. 😓
Describe the solution you'd like
A clear and concise description of what I want to happen is this:
Which would be used like:
Appending everything with a single call while generating labels on the fly:
It would create something like:
Describe alternatives you've considered
This would mirror the original HTML DOM API specification, which would make
pcui
elements feel more natural (at least to me 😅).Original HTML DOM API: https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append
The text was updated successfully, but these errors were encountered: