Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
shinydashboardPlus中默认打开右侧边栏_R_Shiny_Shinydashboard - Fatal编程技术网

shinydashboardPlus中默认打开右侧边栏

shinydashboardPlus中默认打开右侧边栏,r,shiny,shinydashboard,R,Shiny,Shinydashboard,在shinydashboardPlus中,有没有办法让右侧边栏默认打开 library(shiny) library(shinydashboard) shinyApp( ui = dashboardPagePlus( header = dashboardHeaderPlus( enable_rightsidebar = TRUE, rightSidebarIcon = "gears" ), sidebar = dashboardSidebar(

在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) { }
)

您必须将css类
控件侧栏open
添加到仪表板的body标记中

这可以通过以下方式完成:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

shinyApp(
  ui = tags$body(class="skin-blue sidebar-mini control-sidebar-open", 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) {
  }
)

请查找相关信息。

右侧边栏是否也可以永久打开?给未来的读者。