右侧边栏默认在ShinydashboardPlus中打开

时间:2019-11-07 21:00:55

标签: r shiny shinydashboard

是否有任何方法可以在ShinydashboardPlus中默认打开右侧边栏?

library(shiny)
library(shinydashboard)
shinyApp(
  ui = dashboardPagePlus(
    header = dashboardHeaderPlus(
      enable_rightsidebar = TRUE,
      rightSidebarIcon = "gears"
    ),
    sidebar = dashboardSidebar(),
    body = dashboardBody(),
    rightsidebar = rightSidebar(
      background = "dark",
      rightSidebarTabContent(
        id = 1,
        title = "Tab 1",
        icon = "desktop",
        active = TRUE,
        sliderInput(
          "obs",
          "Number of observations:",
          min = 0, max = 1000, value = 500
        )
      )
    ),
    title = "Right Sidebar"
  ),
  server = function(input, output) { }
)

1 个答案:

答案 0 :(得分:1)

您必须将css类Person添加到仪表板的body标签。

这可以如下进行:

control-sidebar-open

请找到一些相关信息herehere