Dynamic attributes with context objects #135
Replies: 3 comments
-
@Anthony-DE-FARIA I get your point. I didn't consider it before but to me, it breaks some protocol in my mind because as soon as you What I did consider is if we allow dropping the quotes and <c-weather today=today></c-weather> I'm not entirely sold on that, what are your thoughts about that? |
Beta Was this translation helpful? Give feedback.
-
personally I'd agree with @wrabit and avoid the {{ }} syntax as my mind goes to "rendering a variable". i guess it might technically 'still work' as the rendered variable could be then passed. But I think of the case where it'd a django ORM object would happen quite frequently and not work great in that regard. I'd vote in favor of |
Beta Was this translation helpful? Give feedback.
-
Yep, after using dj-cotton again and again for the past weeks I agree with you guys. Named slots are doing the job perfectly if I need to introduce {{ today }} for context clarity for example. |
Beta Was this translation helpful? Give feedback.
-
Hey @wrabit,
What do you think of this idea? Do you find it relevant or even possible?
Before:
After:
This change helps to quickly identify the context object in Cotton components and also enables auto-completion.
Cheers! 👍🏻
Beta Was this translation helpful? Give feedback.
All reactions