Replies: 3 comments 3 replies
-
I can see the case for this, but we cannot really place But this could work: (I also like it as it feels a bit clearer about what’s going on) <!-- cotton/dropdown_city.html -->
<c-dropdown :attrs="attrs">
<option value="SF">San Francisco</option>
<option value="NY">New York</option>
</c-dropdown> (If we do this right now, we would get a key value pair like: So the outlay of work looks like:
Optional extra:
|
Beta Was this translation helpful? Give feedback.
-
This would be great! To help provide more justification and other use cases, being able to pass a FormField widget's Example where this could be helpful: class TestForm(forms.Form):
expiration = forms.DateField(
widget=forms.DateInput(
attrs={
'type': 'date',
'min': timezone.now().date().isoformat(),
},
format='%Y-%m-%d',
),
required=True,
label='Expiration Date',
) |
Beta Was this translation helpful? Give feedback.
-
@melotte25 Proxying and passing {{ attrs }} dict now supported in 2.1.0 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This one has "got me" twice now. I'd expect attrs to be passed.
High level I reuse the
<div class="... {{ class }}" {{ attrs }}> {{ slot }} </div>
pattern all over.Beta Was this translation helpful? Give feedback.
All reactions