You need to sign in to do that
Don't have an account?
sunny sengar 17
Hi @all, I am new in LWC, And want to convert LC to LWC. Anyone can help
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:handler event="force:showToast" action="{!c.handleToastEvent}"/>
</aura:component>
({
handleToastEvent: function(component, event, helper) {
var toastMessageParams = event.getParams();
var message = toastMessageParams.message;
if(message.includes('saved')) {
setTimeout(function(){ location.reload();}, 1000);
}
}
})
<aura:handler event="force:showToast" action="{!c.handleToastEvent}"/>
</aura:component>
({
handleToastEvent: function(component, event, helper) {
var toastMessageParams = event.getParams();
var message = toastMessageParams.message;
if(message.includes('saved')) {
setTimeout(function(){ location.reload();}, 1000);
}
}
})
force:showToast this is aura standard event it works when any notifaction excute.
but its not work in Lwc.
there is no chance.
don't forget to mark it as best answer.
Thank you