<p:confirm message> 中的换行符 [英] Newline in <p:confirm message>
本文介绍了<p:confirm message> 中的换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在
组件的消息中换行?
Is there a way to put a new line in the message of <p:confirm>
component?
<p:confirm header="Confirmation"
message="Are you sure you want to continue? Bla bla bla"
icon="ui-icon-alert" />
我想在新行中添加Bla bla bla".
I would like to have "Bla bla bla" in a new line.
推荐答案
当时我问这个问题时,confirm
组件中没有转义选项,但在此之后它在 PrimeFaces 6.2 上实现了
At the time I asked this question there was no escape option in confirm
component but it was implemented on PrimeFaces 6.2 after this feature request.
所以现在我们可以这样做:
So now we can just do it this way:
<p:confirm header="Confirmation"
escape="false"
message="Are you sure you want to continue? <br/> Bla bla bla"
icon="ui-icon-alert" />
或者,可以使用其他答案中已经建议的 confirmDialog
组件.
Alternatively, it's possible to use confirmDialog
component as already suggested in other answers.
这篇关于<p:confirm message> 中的换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文