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
<button@click:=component.setValuepayload="green">Set to green</button><button@click:=component.setValuepayload="blue">Set to blue</button>
Also for completeness, if this is ever invoked, add a stateChangedCallback to component, and some way it writes it to a state (maybe a special state variable ALWAYS called "value")
// Include this and use setValue to make a component behave a bit like an input// with a change eventletisBool=null;functioninitializedCallback(){element.stateChangedCallback=(function(name,newValue,el){this.value=newValue;if(isBool){this.value=!!this.value;}this.cparts.state.value=this.value;// ensure setthis.rerender();}).bind(element);if(isBool===null){isBool=typeofstate.value==='boolean';}state.value=props.value||'';if(isBool){state.value=!!state.value;}element.value=state.value;}functionsetValue(payload){if(isBool){element.value=!element.value;}else{element.value=payload;}state.value=element.value;element.dispatchEvent(newwindow.Event('change'));}
Already in repo, just needs docs (when Recipe system is final)
Activity
michaelpb commentedon Feb 22, 2023
Recipe is below:
Already in repo, just needs docs (when Recipe system is final)