问题
What is the easiest way to switch on and off Toastr JS ? I did not find a solution in the docs. My project is an angulat one, I am using Toastr for my dev environnement and want toasts to stop displaying when building.
回答1:
No need to add a CSS rule-set. You can just use the target option:
// turn off
toastr.options.target = null
// turn on
toastr.options.target = 'body'
回答2:
Easiest answer is via css of course.
#toast-container {
display:none;
}
来源:https://stackoverflow.com/questions/40381579/how-to-easily-switch-off-toastr-js