
您可以使用css
white-space: pre-line;&
n在翻译文本中执行此 *** 作。
const root = document.getElementById('root');i18next.init({ lng: 'en', resources: { en: { translation: { "key": "Hello worldnThis sentence should appear on the second line" } } }}, function(err, t) { // initialized and ready to go! root.innerHTML = i18next.t('key');});#root { white-space: pre-line;}<script src="https://unpkg.com/i18next@15.0.9/dist/umd/i18next.min.js"></script><div id="root"></div>欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)