我有一个用shinydashboardPlus()
创建的仪表板。我想知道是否只有当我在名为“ First”的tabPanel中时才可以显示右侧边栏。
#app.r
library(shinydashboardPlus)
library(shiny)
library(shinydashboard)
shinyApp(
ui = dashboardPagePlus(
header = dashboardHeaderPlus(
enable_rightsidebar = TRUE,
rightSidebarIcon = "gears"
),
sidebar = dashboardSidebar(
selectInput("sel","Select",choices=c("FIRST","SECOND"),selected = "FIRST")
),
body = dashboardBody(
tabsetPanel(id="T",type="tabs",
tabPanel("First"),
tabPanel("Second"))
),
rightsidebar = rightSidebar(
background = "dark",
rightSidebarTabContent(
id = 1,
title = "Tab 1",
icon = "desktop",
active = TRUE
)
),
title = "Right Sidebar"
),
server = function(input, output) {
}
)