gpt4 book ai didi

css - 如何在 react Bootstrap 中的工具提示内放置换行符?

转载 作者:行者123 更新时间:2023-12-04 10:19:11 24 4
gpt4 key购买 nike

我需要在 react bootstrap 工具提示中放置一个长段落,我需要在某些地方换行。我试过\n ,br,em 什么都没有给我换行。

export const TooltipMessages = {
product:
"Here we can see list of Product created and we can create a New product \r\n." +
"We have 3 types of product Managed, Unmanaged and Source." +
"Managed Product : Managed product is where by default all the environments are created
i.e Evaluation, Development," +
"Test & Production."
}

和工具提示代码
<Tooltip id={`tooltip-top`} className="mytooltip">
{ToolTipMessage.product}
</Tooltip>

最佳答案

你可以使用这样的东西:

react fiddle

NOTE: It was not allowing me to add only fiddle so added only css and html code, full functionality is available in fiddle.



.display-linebreak {
white-space: pre-line;
}
<div id="app">


</div>

关于css - 如何在 react Bootstrap 中的工具提示内放置换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60946492/

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