gpt4 book ai didi

toastr - 如何在 toastr 中显示多行消息?

转载 作者:行者123 更新时间:2023-12-04 01:37:46 24 4
gpt4 key购买 nike

如何在 toastr 中显示多行错误消息?

我已经格式化了我的错误消息,如下所示

"Please fix the following: \r\nFirst Name is required\r\nLast Name is required\r\nEmail Address is required\r\n"

但是在toasrt中,它以单行显示。请帮忙

最佳答案

正如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 });
这将工作!感谢您的帮助。

关于toastr - 如何在 toastr 中显示多行消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36908445/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com