r - 在 R 中更改通知的颜色闪亮
问题描述
我正在尝试使用“showNotification”功能来显示绿色弹出窗口。
官方文档说,你可以使用参数'type'来改变颜色。
type A string which controls the color of the notification. One of "default" (gray), "message" (blue), "warning" (yellow), or "error" (red).
有没有人试过这个?
有没有办法使用 HTML/HEX 代码?
更新
我最终重新着色了单一类型的 showNotifications,如下所示:
tags$head(tags$style(HTML('
.shiny-notification-error {
background-color:#FF5757;
color:#000000;
}
.shiny-notification-message {
background-color:#B5E26F;
color:#000000;
}
'))),
解决方案
您可以自己添加一些样式:
library(shiny)
shinyApp(
ui = fluidPage(
tags$head(
tags$style(
HTML(".shiny-notification {background-color:#112446;}")
)
),
actionButton("show", "Show")
),
server = function(input, output) {
observeEvent(input$show, {
showNotification("Message text",action = a(href = "javascript:location.reload();", "Reload page"),type = "warning"
)
})
}
)
推荐阅读
- typescript - 设置 tsconfig.json 目标会破坏路径
- android - 如何在 Kotlin 中打开菜单项选择的新页面?
- excel - 在vba中的大写字母前放置一个空格
- database - 有没有办法为 SQL 查询等迭代器优化 Rust 过滤器?
- angular - 如何在另一个formArray中禁用反应式表单控件
- search - 在 MarkLogic java API 中提取属性并获取结果
- php - 将内容从 Drupal 7 迁移到 CSV 或另一个 MySQL 数据库
- c# - C# - 如何使用 ushort 在 byte[] 前添加并通过 TCP 发送
- eclipse - 我正在尝试运行 eclipse kura 模拟器并遇到某些错误,您可以帮助解决问题吗?
- datetime - Power BI - 日期时间列表 - 多对多查询合并