You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In the case of complex components which take a ton of attributes (something like a generic CrudForm or things like that) I usually split them up to one per line. In this case it would sometimes be useful to add comments to specific attributes to explain something about them. Right now there is no way (that I know of) to add any sort comment in the middle of an attribute list.
Describe the solution you'd like
I would like to be able to add comments of some sort in the middle of an attribute list, for example:
<ComplexComponentstuff1="stuff1"
stuff2="STUFF2" <<< I'd like to write something about why stuff2 is uppercase here
stuff3="stuff3"
/>
An idea of how this could look would be to use {/* ... */} as syntax (and in extension to allow, albeit meaningless, {} and just emit a warning for it - right now it crashes, see #6086):
<ComplexComponentstuff1="stuff1"
stuff2="STUFF2" {/* stuff2 needs to be uppercase because reasons */}
stuff3="stuff3"
/>
Open to better ideas of course...
Describe alternatives you've considered
One alternative would be to pass props using {...{a: 'a', b: 'b'}} instead of a="a" b="b" (which is a JS expression and therefore allows /* ... */ in the middle), but that means that it looks and behaves differently from other usages of attributes, so it's not ideal. Also, you can't do that with bind:x, let:x, on:x or slot then.
<ComplexComponent{...{stuff1: 'stuff1',
stuff2: 'STUFF2' // stuff2 needs to be uppercase because reasons
stuff3: 'stuff3'
}} />
The way I currently use is {...{/* comment */}} which works but is ugly of course.
<ComplexComponentstuff1="stuff1"
stuff2="STUFF2" {...{/* stuff2 needs to be uppercase because reasons */}}
stuff3="stuff3"
/>
How important is this feature to you?
Not that important, just a nice-to-have
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
In the case of complex components which take a ton of attributes (something like a generic
CrudForm
or things like that) I usually split them up to one per line. In this case it would sometimes be useful to add comments to specific attributes to explain something about them. Right now there is no way (that I know of) to add any sort comment in the middle of an attribute list.Describe the solution you'd like
I would like to be able to add comments of some sort in the middle of an attribute list, for example:
An idea of how this could look would be to use
{/* ... */}
as syntax (and in extension to allow, albeit meaningless,{}
and just emit a warning for it - right now it crashes, see #6086):Open to better ideas of course...
Describe alternatives you've considered
One alternative would be to pass props using
{...{a: 'a', b: 'b'}}
instead ofa="a" b="b"
(which is a JS expression and therefore allows/* ... */
in the middle), but that means that it looks and behaves differently from other usages of attributes, so it's not ideal. Also, you can't do that withbind:x
,let:x
,on:x
orslot
then.The way I currently use is
{...{/* comment */}}
which works but is ugly of course.How important is this feature to you?
Not that important, just a nice-to-have
The text was updated successfully, but these errors were encountered: