问题描述
我正在使用alertable.js 。
当我尝试换行时,它不起作用。
我尝试:
$.alertable.confirm('Line1\nLine2').then(function() {
//ok
}, function() {
//not
});
1楼
Nick Parsons
2
已采纳
2019-02-25 05:50:35
您输入confirm的字符串就是显示为HTML的字符串。
在HTML中, \\n不会解析为换行符,因此可以正常显示。
相反,如果将设置为true,则可以像这样使用HTML中断标签<br /> :
$.alertable.confirm('Line1<br />Line2', {
html: true
}).then(function() {
//ok
}, function() {
//not
});
在查看工作示例
2楼
Nisarg
0
2019-02-25 05:54:03
尝试将message选项设置为html并在新行中插入<br/>标记而不是\\n :
$.alertable.confirm('Line1 <br/> Line2', {
html: true,
}).then(function() {
//ok
}, function() {
//not
});
您可以在此处参考文档: :