How to easily switch off Toastr JS

守給你的承諾、 提交于 2019-12-12 06:30:12

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!