reactjs - React - 如何将字体大小添加到 React.createElement 中?
问题描述
我是块新手并学习 React - 我在下面有这部分功能:
AlertNotifications.prototype.render = function () {
return (React.createElement("div", null, this.props.alerts.map(function (alert) { return React.createElement(MessageBar, { messageBarType: alert.type === AlertType.Urgent ? MessageBarType.severeWarning : MessageBarType.warning, isMultiline: false },
alert.message,
alert.moreInformationUrl ? React.createElement("a", { href: alert.moreInformationUrl }, strings.MoreInformation) : ''); })));
};
return AlertNotifications;
我需要更改返回的 DIV 的字体大小 - 请让我知道我需要更改什么 - 或者添加到上面以将字体大小更改为 Arial 16px?
提前谢谢了
G
解决方案
您可以添加一个类并为其设置样式。
React.createElement('div', {class-here}, .......)
推荐阅读
- security - 我在网站的源代码中找到了 Google 分析跟踪 ID。这是一个漏洞吗?
- javascript - 溢出隐藏不会在 Safari 浏览器中锁定滚动
- veeam - Powershell 命令 - 在 veeam 中列出 SOBR 分层作业
- sql - POSTGRES JSON:更新列中的数组值
- flutter - 我想要数据类型作为地图
以及如何更改它并从列表中获取项目并添加到地图 - docker - Certbot 未能通过 acme-challenge(连接被拒绝)
- flutter - 我们可以将 PWA 集成到 webview 之类的 Flutter 应用程序中吗?
- php - 是否可以隔离不同 PHP 命名空间中的常量?
- python - Flask 向 HTML 页面添加无限的函数调用
- selenium-webdriver - 在虚拟机中获取 UnreachableBrowserException 异常