Event listeners on a <slot>
Is it possible to natively create event listeners in Toddle that are triggered on a <slot > element whenever the node contained within that slot changes ? Or should I implement this functionality through a custom function ? My use case involves a button component with 'before ' and 'after ' slots for icons . When an icon is present , the padding on the corresponding side of the icon should change from 8px to 4px . Currently , I use two attributes on the component : has _before _icon and has _after _icon . Additionally , I have a formula handle _btn _padding , which sets a style variable for the padding . What are you trying to do - I don 't fully understand . It doesn 't feel like slots are needed if you are using the same basic content in each - it feels like components would get you there , but I don 't know exactly what you are trying to do - and I 'm just studying slots , the last piece I haven 't used . variables inside the same html elements : variables . collections of html elements with various variables and apis that only change the contents of : components . changing the actual HTML elements themselves : slots . Your use case from what little I know of it doesn 't seem to require slots .
.jpeg/public)