[英]How can I change the background color of the selected menuItem in shinydashboard?
I have included a simple example code. 我提供了一个简单的示例代码。 If I selected
Widgets
, the background color of the Widgets
menuItem should change. 如果我选择了
Widgets
,那么Widgets
menuItem的背景色应该改变。
The code is as follows 代码如下
## Only run this example in interactive R sessions
if (interactive()) {
ui <- dashboardPage(
dashboardHeader(title = "Simple tabs"),
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Widgets", tabName = "widgets", icon = icon("th"))
)
),
dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
h2("Dashboard tab content")
),
tabItem(tabName = "widgets",
h2("Widgets tab content")
)
)
)
)
server <- function(input, output, session) {
}
}
shinyApp(ui, server)
Should I add a CSS tag? 我应该添加CSS标签吗? Thank You in advance!
先感谢您!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.