Extra slots for components in general ? #17609
Unanswered
Namidas
asked this question in
Ideas / Proposals
Replies: 1 comment
-
I think the problem with your solution is that it might make the source code a big mess while only solving a few edge cases. Just a single slot with a default definition in the documentation works fine imo. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The title says it all (I believe), and I've been chewing on this idea for quite some time (although more often than not I've managed to solve this with what I had and/or coding some wrapper compos), but here are 2 very specific (and related) examples that I just couldn't find a solution to:
QTable's "records per page" thing...well, actually, this one did have a solution, but I had to rewrite/re-create the whole thing (bottom slot) to be able to change just that.
QPagination has no slot whatsoever, and it becomes a problem when using prop
input
, there's no tooltip whatsoever (neither native nor compo) to what that thing is doing, further more, not even a border on the input (ok, you can change that through props and CSS) and it becomes quite obscure...So...extra slots for components in general, really needed.
Not an expert on Vüe3, and I have no idea how much it costs in terms of processing time, but why not just "abuse" slots?
This is what I usually do (and would have done with QPagination's
<input />
)You may or may not use that input wrapper div, but you get the point I guess...
Any thoughts on this ?
Also, last but not least...since Quasar renders components programatically, why not use some sort of "render slots" prop to set up rendering order? Not in all cases, but there are a lot of situations where this would be quite useful and (I think) not that hard to implement, going back to QTable's bottom slot, and assuming we had separate slots for each part of it (named in order of appearance in this example as "rows-per-page", "rows-current", "pagination"), you could have a QTable prop named (for instance) "slotsOrder", an array that defaults to
["rows-per-page","rows-current","pagination"]
, and be able to just feed any other order (or even not include all slot names, for conditional rendering, instead of having to define an empty slot or having an extra property just to void a specific slot)Just saying..
Anyways, excellent work, totally inlove with the Q ♥
Beta Was this translation helpful? Give feedback.
All reactions