如何在烤面包中显示多行错误信息??
我已将错误消息格式化如下
"Please fix the following: \r\nFirst Name is required\r\nLast Name is required\r\nEmail Address is required\r\n"但在图中,它显示在单行。请帮帮忙
发布于 2016-04-28 09:56:42
正如Dr.Stitch所告诉的,toastr使用字符串作为html,因此我们必须为新行添加:
Please fix the following: </br>First Name is required</br>Last Name is required</br>Email Address is required</br>-更新日期:2020年12月15日:
版本12+ :
toastr.success('Please fix the following: </br>First Name is required</br>Last Name is required</br>Email Address is required</br>', '', { closeButton: true, timeOut: 4000, progressBar: true, allowHtml: true });这会成功的!谢谢你的帮助。
发布于 2017-04-26 10:32:12
allowHtml:真
toastr.success('\'Second Review\' validation has started. </br>All SME\'s and Reviewers will get an email notification', '', { closeButton: true, timeOut: 4000, progressBar: true, allowHtml: true });发布于 2020-06-14 11:06:46
请注意
ng-烤面包机v12.1.0
它是enableHtml,而不是allowHtml,以<br />作为HTML。
也可能在旧版本中更改。
https://stackoverflow.com/questions/36908445
复制相似问题