仅显示shinydashboardPlus()中特定的tabPanel()的右侧栏

时间:2019-10-07 22:10:54

标签: r shinydashboard

我有一个用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) {


  }
)

0 个答案:

没有答案